daily pastebin goal
58%
SHARE
TWEET

Untitled

a guest Jun 7th, 2017 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $dbhost = "localhost";
  3. $dbuser = "admin";
  4. $dbpass = "***";
  5. $dbname = "***";
  6. mysql_connect($dbhost, $dbuser, $dbpass);
  7. mysql_select_db($dbname) or die(mysql_error());
  8. //$sql = mysql_query("SELECT * FROM shipping_instructions WHERE id = 1") or die(mysql_error());
  9. //$array = mysql_fetch_array($sql);
  10.  
  11.  
  12.         $order_number = (int)$_GET['order_number'];
  13.         $check_duplicate = mysql_query("SELECT id FROM shipping_instructions WHERE order_number = '$order_number' LIMIT 1") or die(mysql_error());
  14.         if(mysql_num_rows($check_duplicate) > 0) {
  15.                   echo json_encode(array('code'  =>  0,
  16.                   'result'  =>  "This order number was entered before. Are you sure you want to create this order? <br />
  17.                                 <span style=padding-left:10px;><a href=shippingI_create_list.php?action=add&order_number=".$order_number."><img src=shippinginstructions/button_yes.png border=0 /></a> <a href=shippingI_create_list.php><img src=shippinginstructions/button_no.png border=0 /></a></span>
  18.                   "
  19.                   ));
  20.                   die;
  21.         }else{
  22.             $sql = mysql_query("SELECT orders_id FROM orders WHERE orders_id = '$order_number' LIMIT 1") or die(mysql_error());
  23.             if(mysql_num_rows($sql) > 0) {
  24.                   echo json_encode(array('code'  =>  2,
  25.                   'result'  =>  "$order_number"
  26.                   ));
  27.                   die;
  28.             }else{
  29.                   echo json_encode(array('code'  =>  0,
  30.                   'result'  =>  "this order number doesn't exist please enter correct order number ".$order_number.""
  31.                   ));
  32.                   die;
  33.             }
  34.         }
  35.  
  36. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top