Guest User

Untitled

a guest
Sep 8th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.68 KB | None | 0 0
  1. <?php
  2.  
  3. $mysql_host = 'ephesus.cs.cf.ac.uk';
  4. $mysql_user = 'c1018921';
  5. $mysql_pass = '';
  6.  
  7. $name = $_POST['name'];
  8. $surname = $_POST['surname']; // Make sure you check both of these for mysql injection if this is proper work.
  9.  
  10. mysql_connect($mysql_host, $mysql_user, $mysql_pass);
  11.  
  12. mysql_select_db('c1018921');
  13.  
  14. mysql_query("INSERT INTO `Info` (`name`, `surname`) VALUES ('{$name}', '{$surname}')");
  15.  
  16. ?>
  17.  
  18. <form action="" method="post">
  19.  
  20. <br><label>name</label><br />
  21. <input type="text" name="name" value="" /><br />
  22.  
  23. <br><label>surname</label><br />
  24. <input type="text" name="surname" value="" /><br />
  25.            
  26. <input type="submit" name="submit" value="Register" />
  27.        
  28. </form>
Add Comment
Please, Sign In to add comment