How to check ajax request or not

if (!empty($_SERVER[‘HTTP_X_REQUESTED_WITH’]) && strtolower($_SERVER[‘HTTP_X_REQUESTED_WITH’]) == ‘xmlhttprequest’ ) { // It is ajax Request }

avoid duplicate value insertion on page refresh in php

TO AVOID DUPLICATE VALUE INSERT IN CORE PHP ON REFRESH:: During the post value insertion in the database, after refresh duplicate value inserted in the table. To avoid this, we can redirects after insertion to the same page. It will destroy the post values. code is:: header(‘Location: ‘.$_SERVER[‘PHP_SELF’].’?data=1); die;

populate popup page using javascript

SHOW POPUP:: Javascript Code: function showmepop(plink,pname) {, pname, “top=10,left=20,width=600,height=400″);  } Html code:: <button onclick=”showmepop(‘<?php echo $QUOTELINK;?>’,’test’);”>View</button>

Get select box value among many select box using Jquery

AFTER APPEND IN BODY.. We Can Get value of selected select box using jquery. It works. checked already.. $(document).on(‘change’, “select.optn”, function () { var ID = $(this).attr(“id”); alert(countryID); });

combine two array in php

## COMBINE OF TWO ARRAYS INTO ONE ARRAY $PRO_QTY_ARR = array(); $TMP_M=0; $TMP_N=0; foreach($product_id_arr as $value) { $PRO_QTY_ARR[$TMP_M][‘P’] = $value; TMP_M++; } foreach($product_qty_arr as $q) { $PRO_QTY_ARR[$TMP_N][‘Q’] = $q; $TMP_N++; } print_r($PRO_QTY_ARR);