Guest User

Untitled

a guest
Dec 8th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. <html>
  2. <body>
  3.  
  4.  
  5. <?php
  6.  
  7.  
  8. $con = mysql_connect("localhost","","");
  9.  
  10. $user=$_POST["user"];
  11. $nome=$_POST["nome"];
  12. $password=$_POST["password"];
  13. $email=$_POST["email"];
  14. $codico=$_POST["codico"];
  15. $localidade=$_POST["Localidade"];
  16.  
  17. if (!$con)
  18. {
  19. die('Could not connect: ' . mysql_error());
  20. }
  21.  
  22. mysql_select_db("book", $con);
  23.  
  24.  
  25.  
  26. $veriemail= mysql_query("SELECT Email FROM cliente");
  27.  
  28. if ($veriemail==$_POST["email"])
  29.  
  30. echo "Ja existe este email";
  31.  
  32.  
  33.  
  34.  
  35. $inserir=mysql_query("INSERT INTO cliente (Username, AdminY/N, Nome, Password, Email ,CodicoP ,Localidade)
  36. VALUES ('$user', '0', '$nome', '$password', '$email', '$codico', '$localidade')");;
  37.  
  38. if($inserir==1)
  39. echo"feito";
  40.  
  41. mysql_close($con);
  42.  
  43. ?>
  44. </body>
  45. </html>
Add Comment
Please, Sign In to add comment