Advertisement
Guest User

Untitled

a guest
Oct 2nd, 2014
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.67 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <link type="text/css" rel="stylesheet" href="bootstrap/css/bootstrap.css">
  5. <link type="text/css" rel="stylesheet" href="bootstrap/css/myStyle.css">
  6. <title>OJRA - Registration</title>
  7. </head>
  8. <body>
  9. <div style="width:400px; height:400px; border-radius:5px; background-color:#aaa; margin-left:100px;">
  10. <form action="" method="post" style="margin-left:20px;">
  11. <h6>Username</h6>
  12. <input type="text" name="username" placeholder="Your Username">
  13. <h6>Password</h6>
  14. <input type="password" name="usrPassowrd" placeholder="Your password">
  15. <h6>Email</h6>
  16. <input type="email" name="usrEmail" placeholder="Your Email"><br>
  17. <input class = "btn btn-default" type="submit" value = "Register">
  18. </form>
  19.  
  20. </div>
  21. <div style="width:400px; height:400px; border-radius:5px; background-color:#aaa; margin-left:100px;">
  22. <form action="" method="post" style="margin-left:20px;">
  23. <h6>Username:</h6> <input type="text" name="username" placeholder="Your username">
  24. <h6>Password:</h6> <input type="password" name="usrPassowrd" placeholder="Your password">
  25. <input class = "btn btn-default" type="submit" value="Sign in">
  26. </form>
  27. <?php
  28. define('INCLUDE_CHECK',true);
  29.  
  30. require 'connect.php';
  31.  
  32.  
  33. $username = $_POST['username'];
  34. if($username == "")
  35. {
  36. die("cannot go empty");
  37. header("location:index.php");
  38. exit;
  39. }
  40. $password = $_POST['usrPassword'];
  41. $email = $_POST['usrEmail'];
  42.  
  43. $query = "insert into tz_members values('$username', '$password', '$email')";
  44. mysql_query($query) or die(mysql_error());
  45.  
  46.  
  47. ?>
  48. </div>
  49. <img src="sexymotivation.jpg" style="margin-top:-800px; margin-right:10px;" class="pull-right">
  50. </body>
  51. </html>
  52.  
  53. <!DOCTYPE html>
  54. <html>
  55. <head>
  56. <link type="text/css" rel="stylesheet" href="bootstrap/css/bootstrap.css">
  57. <link type="text/css" rel="stylesheet" href="bootstrap/css/myStyle.css">
  58. <title>OJRA - Registration</title>
  59. </head>
  60. <body>
  61. <div style="width:400px; height:400px; border-radius:5px; background-color:#aaa; margin-left:100px;">
  62. <form action="" method="post" style="margin-left:20px;">
  63. <h6>Username</h6>
  64. <input type="text" name="username" placeholder="Your Username">
  65. <h6>Password</h6>
  66. <input type="password" name="usrPassword" placeholder="Your password">
  67. <h6>Email</h6>
  68. <input type="email" name="usrEmail" placeholder="Your Email"><br>
  69. <input class = "btn btn-default" type="submit" value = "Register">
  70. </form>
  71.  
  72. </div>
  73. <div style="width:400px; height:400px; border-radius:5px; background-color:#aaa; margin-left:100px;">
  74. <form action="" method="post" style="margin-left:20px;">
  75. <h6>Username:</h6> <input type="text" name="username" placeholder="Your username">
  76. <h6>Password:</h6> <input type="password" name="usrPassword" placeholder="Your password">
  77. <input class = "btn btn-default" name="submit" type="submit" value="Sign in">
  78. </form>
  79.  
  80. <?php
  81. // this below, will prevent a premature execution of code
  82. if(isset($_POST['submit'])){
  83.  
  84. define('INCLUDE_CHECK',true);
  85.  
  86. require 'connect.php';
  87.  
  88. $username = $_POST['username'];
  89. if($username == "")
  90. {
  91. die("cannot go empty");
  92. // header("location:index.php"); // commented out
  93. exit;
  94. }
  95. $password = $_POST['usrPassword'];
  96. $email = $_POST['usrEmail'];
  97.  
  98. $query = "insert into tz_members values('$username', '$password', '$email')";
  99. mysql_query($query) or die(mysql_error());
  100.  
  101. } // end brace for if(isset($_POST['submit']))
  102.  
  103. ?>
  104. </div>
  105. <!-- commented out original img src -->
  106. <!--
  107. <img src="sexymotivation.jpg" style="margin-top:-800px; margin-right:10px;" class="pull-right">
  108. -->
  109.  
  110. <!-- new img src by user3009875 in an answer given -->
  111. <img src="sexymotivation.jpg" style="margin-top:100px; margin-right:10px;" class="pull-right">
  112. </body>
  113. </html>
  114.  
  115. <img src="sexymotivation.jpg" style="margin-top:100px; margin-right:10px;" class="pull-right">
  116.  
  117. die("cannot go empty");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement