Guest User

Untitled

a guest
Jun 21st, 2018
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.27 KB | None | 0 0
  1. siteeee
  2.  
  3. ___________________
  4.  
  5. <html>
  6.  
  7. <head>
  8. <meta http-equiv="Content-Language" content="pt">
  9. <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
  10. <title>Registo</title>
  11. </head>
  12.  
  13. <body background="back.jpg">
  14.  
  15. <p>&nbsp;</p>
  16. <p>&nbsp;</p>
  17. <p>&nbsp;</p>
  18. <p>&nbsp;</p>
  19. <div style="position: absolute; width: 645px; height: 348px; z-index: 1; left: 319px; top: 199px" id="camada1">
  20. <p align="center"><font face="SimLLHP" size="6">Formulario de registo</font></p>
  21.  
  22. <form method=”post” action=”adiciona.php”>
  23.  
  24. <table border="0" width="645">
  25. <tr>
  26. <td width="212"><font face="SimLLHP">Nome :</font></td>
  27. <td align="center" width="423">
  28. <p align="center"><font face="SimLLHP" color="#FF00FF">
  29. <input type="text" size="58" name="nome"></font></td>
  30. </tr>
  31. <tr>
  32. <td width="212"><font face="SimLLHP">Telefone :</font></td>
  33. <td align="center" width="423">
  34. <p align="center"><font face="SimLLHP" color="#FF00FF">
  35. <input type="text" size="58" name="Tfl"></font></td>
  36. </tr>
  37. <tr>
  38. <td width="212"><font face="SimLLHP">E-mail :</font></td>
  39. <td align="center" width="423"><font face="SimLLHP" color="#FF00FF">
  40. <input type="text" size="58" name="email"></font></td>
  41. </tr>
  42. <tr>
  43. <td width="212"><font face="SimLLHP">Morada :</font></td>
  44. <td align="center" width="423"><font face="SimLLHP" color="#FF00FF">
  45. <input type="text" size="58" name="morada"></font></td>
  46. </tr>
  47. <tr>
  48. <td width="212" height="24">&nbsp;</td>
  49. <td align="center" height="24" width="423">&nbsp;</td>
  50. </tr>
  51. <tr>
  52. <td width="212" height="24"><font face="SimLLHP">Username :</font></td>
  53. <td align="center" height="24" width="423"><font face="SimLLHP" color="#FF00FF">
  54. <input type="text" size="32" name="username"></font></td>
  55. </tr>
  56. <tr>
  57. <td width="212" height="24"><font face="SimLLHP">Password :</font></td>
  58. <td align="center" height="24" width="423"><font face="SimLLHP" color="#FF00FF">
  59. <input type="password" size="32" name="pass1"></font></td>
  60. </tr>
  61. <tr>
  62. <td width="212" height="24"><font face="SimLLHP">Reescreve a
  63. password :</font></td>
  64. <td align="center" height="24" width="423"><font face="SimLLHP" color="#FF00FF">
  65. <input type="password" size="32" name="pass2"></font></td>
  66. </tr>
  67. <tr>
  68. <td width="635" height="21" colspan="2">&nbsp;</td>
  69. </tr>
  70. <tr>
  71. <td height="31" width="635" colspan="2">
  72. <p align="center"><input type="submit" name="aceitar" value="Confirmar Registo">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  73. <input type="reset" value="Cancelar Registo"></span></td>
  74. </tr>
  75. </table>
  76. </form>
  77. </div>
  78.  
  79. </body>
  80.  
  81. </html>
  82.  
  83. ___________________________
  84.  
  85.  
  86. PHP
  87.  
  88. <?php
  89.  
  90. if(isset($_POST['nome']) && //COntinua a meter issets por cada valor do form)
  91. {
  92. $name=$_POST['nome'];
  93. $telefone=$_POST['tlf'];
  94. $mail=$_POST['email'];
  95. $nick=$_POST['username'];
  96. $password1=$_POST['pass1'];
  97. $password2=$_POST['pass2'];
  98.  
  99.  
  100. $conexao=odbc_connect("BD","","");
  101.  
  102. $sql="Insert into Clientes (nome, tlf, email, username, pass1) values ('$name','$telefone','$mail','$nick','$password')";
  103.  
  104. $resultado=odbc_exec($conexao,$sql);
  105.  
  106. if ($resultado)
  107.  
  108. echo"Inserido com sucesso";
  109.  
  110. else echo "Registo não inserido";
  111.  
  112. odbc_free_result($resultado);
  113.  
  114. odbc_close($conexao);
  115. }
  116.  
  117.  
  118. ?>
Add Comment
Please, Sign In to add comment