Guest User

Untitled

a guest
Apr 15th, 2019
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.56 KB | None | 0 0
  1. <?php
  2.     $secret_key = filter_input(INPUT_POST, 'secret_key');
  3.     if(empty($secret_key)):
  4.         echo "Necessary field is empty, please fill it";
  5.         die();
  6.    
  7.     $host = "localhost";
  8.     $dbusername = "root";
  9.     $dbpassword = "";
  10.     $dbname = "aniket";
  11.     // Create connection
  12.    
  13.     mysql_connect($host, $dbusername, $dbpassword);
  14.     mysql_select_db($dbname);
  15.     $sql = "SELECT enrollment_no from secret_keys WHERE secret_key='$secret_key'";
  16.     $result = mysql_query($sql) or die(mysql_error());
  17.     echo "Enrollment Number: ".$result;
  18. ?>
Add Comment
Please, Sign In to add comment