Advertisement
Guest User

Untitled

a guest
Mar 16th, 2016
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.62 KB | None | 0 0
  1. <form name="registration_form" method="post" action="user_confirm.php"
  2. onsubmit="return Validate();">
  3. User Name:
  4. <input type="text" name="username"/><br /><br />
  5.  
  6. Password:
  7. <input type="password" name="password" /><br /><br />
  8. Retype Password:
  9. <input type="password" name="password_confirmation"><br /><br />
  10. Name:
  11. <input type="text" name="name" /><br /><br />
  12. Phone Number:
  13. <input type="text" name="phone_number"><br />
  14. <br />
  15. <input type="submit" value="Click here to confirm" /><br />
  16.  
  17. </form>
  18.  
  19. <?php
  20. $username= $_POST['username'];
  21. $name = $_POST['name'];
  22. $phone_numbe = $_POST['phone_numbe'];
  23.  
  24. echo $username "<br>";
  25. echo $name "<br>";
  26. echo $phone_number " <br>";
  27. ?>
  28.  
  29. <form action="register2_db.php" method="post">
  30. <input type="hidden" name="redirect_values" value="true">
  31. <input type="submit" name="confirm" value="Confirm Details">
  32. <input type="button" name="return" value="Return to data" onClick="javascript: window.history.back(-1)";>
  33. </form>
  34.  
  35. <?
  36.  
  37. $host="localhost"; // Host name
  38. $username="fissioni"; // Mysql username
  39. $password="password("; // Mysql password
  40. $db_name="fissioni_test"; // Database name
  41. $tbl_name="members"; // Table name
  42.  
  43. // Connect to server and select databse.
  44. mysql_connect("$host", "$username", "$password")or die("cannot connect");
  45. mysql_select_db("$db_name")or die("cannot select DB");
  46.  
  47. $query = 'insert into members (username,password,name,phone_number)
  48. values
  49. (
  50. "' . $_POST['username'] . '",
  51. "' . md5($_POST['password']) . '",
  52. "' . $_POST['name'] . '",
  53. "' . $_POST['phone_number'] . '",
  54. )';
  55.  
  56. $result = mysql_query($query);
  57.  
  58. if($result){
  59. echo '<h1>Thank you</h1> <br> Go back to the main page <a href="index.html");';
  60. }else{
  61. echo "ERROR: ".mysql_error();
  62. }
  63.  
  64. ?>
  65.  
  66. <form action="register2_db.php" method="post">
  67. <input type="hidden" name="name" value="<?php echo $name?>">
  68. <input type="hidden" name="password" value="<?php echo $password?>">
  69. <input type="hidden" name="username" value="<?php echo $username?>">
  70. <input type="hidden" name="phone_number" value="<?php echo $phone_number?>">
  71.  
  72. <input type="hidden" name="redirect_values" value="true">
  73. <input type="submit" name="confirm" value="Confirm Details">
  74. <input type="button" name="return" value="Return to data" onClick="javascript: window.history.back(-1)";>
  75. </form>
  76.  
  77. <form action='final.php' method = 'POST'>
  78. <input type = 'hidden' name = 'username' value='<?php echo $username;?>' />
  79. ....
  80. </form>
  81. <?php
  82. echo $username "
  83. "; echo $name "
  84. "; echo $phone_number "
  85. ";
  86. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement