Advertisement
Guest User

Untitled

a guest
Jan 12th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. <?php
  2.  
  3. session_start();
  4. ob_start();
  5. $host="localhost";
  6. $username="root";
  7. $db_name="mydb";
  8. $tbl_name="mytable";
  9. $mysqlpass="";
  10.  
  11. $connect = mysql_connect($host, $username, $mysqlpass) or die("couldn't connect");
  12.  
  13. mysql_select_db($db_name,$connect);
  14.  
  15. $user=$_POST['user'];
  16. $password=$_POST['password'];
  17.  
  18. $query="INSERT INTO mytable (user, password) VALUES ('".$user."', '".$password."');";
  19.  
  20. mysql_query($query,$connect);
  21.  
  22. ob_end_flush();
  23.  
  24. ?>
  25.  
  26. mysql -u root
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement