Advertisement
Guest User

Untitled

a guest
Feb 28th, 2014
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. <form action="script.php" method="post">
  2. <input type="text" name="jmeno">
  3. <input type="submit" name="submit" value="Odeslat">
  4.  
  5. </form>
  6.  
  7. // script.php
  8.  
  9. <?PHP
  10.  
  11. if (isset($_POST['submit']) && $_POST['submit']=="Odeslat")
  12. {
  13. $pripojeni = mysql_connect("localhost","root","lamalama","databases");
  14. mysql_query("INSERT INTO test (jmeno) VALUES ('".mysql_real_escape_string($_GET["jmeno"])."')",$pripojeni);
  15. mysql_close($pripojeni);
  16. }
  17.  
  18. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement