Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. <html>
  2. <body>
  3. <form method="post">
  4. Nume
  5. <input type="text" name="user"><br>
  6. Varsta:
  7. <input type="text" name="age"><br>
  8. Parola:
  9. <input type="password" name="parola"><br>
  10. Email:
  11. <input type="text" name="email"><br>
  12. <input type="submit" name="submit" value="OK">
  13. </form>
  14. </body>
  15. </html>
  16. <?php
  17. if(isset($_POST['submit']))
  18. {
  19. $servername = "localhost";
  20. $username = "root";
  21. $password = "";
  22. $dbname = "site";
  23. $conn =mysql_connect($servername,$username,$password);
  24. $db= mysql_select_db($dbname);
  25. if (mysql_error($conn))
  26. {
  27. die("Connection failed: " . $conn->connect_error);
  28. }
  29. $user=$_POST['user'];
  30. $age=$_POST['age'];
  31. $parola=$_POST['parola'];
  32. $email=$_POST['email'];
  33. $sql = "INSERT INTO form (user,age,email) Values('$user','$age','$email')";
  34. $result = mysql_query($sql);
  35. echo "Date introduse cu success!";
  36. }
  37. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement