Advertisement
Guest User

regaspx!!1

a guest
May 21st, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.88 KB | None | 0 0
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Registration.aspx.cs" Inherits="DataBaseProject.Pages2.Registration" %>
  2.  
  3. <!DOCTYPE html>
  4.  
  5. <html xmlns="http://www.w3.org/1999/xhtml">
  6. <head runat="server">
  7.  
  8. <title>Sign-Up</title>
  9. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"/>
  10. <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css"/>
  11. <style>
  12. body {
  13. background-image: url(Images/Magen_David.jpg);
  14. background-repeat: no-repeat;
  15. background-position: center top;
  16. background-attachment: fixed;
  17. }
  18.  
  19. .buttons3 {
  20. margin-left: 15px;
  21. border-radius: 15px 50px;
  22. }
  23.  
  24. .warning {
  25. margin-left: 15px;
  26. font-size: 24px;
  27. font-weight: bold;
  28. }
  29. </style>
  30. <script src="../JS/Registration.js"></script>
  31. <script src='https://www.google.com/recaptcha/api.js'></script>
  32. </head>
  33. <body style="background-image:url(Images/Magen_David.jpg)" onload="Captha()">
  34. <%--<img src="Images/1200px-Magen_David_Adom.jpg.png" />--%>
  35.  
  36. <div class="w3-container w3-red"><h1>Registration</h1></div>
  37.  
  38. <form method="post" onsubmit="return AllChecks()" runat="server">
  39. <table>
  40. <tr>
  41. <td><label>First name:</label></td>
  42. <td><input style="width: 300px" onkeypress="CheckFirstName()" class="w3-input w3-border w3-round-xxlarge" <%--required--%> type="text" name="First_Name" id="First_Name" placeholder="Yuval" size="20" maxlength="15" /></td>
  43. <td><div id="errFirstName"></div></td>
  44. </tr>
  45. <tr>
  46. <td><label>Last name:</label></td>
  47. <td><input style="width: 300px" onkeypress="CheckLastName()" class="w3-input w3-border w3-round-xxlarge" <%--required--%> type="text" name="Last_Name" id="Last_Name" placeholder="Yarmus" size="20" maxlength="15" /></td>
  48. <td><div id="errLastName"></div></td>
  49. </tr>
  50. <tr>
  51. <td><label>E-mail</label></td>
  52. <td><input style="width: 300px" onkeypress="CheckEmail()" class="w3-input w3-border w3-round-xxlarge" <%--required--%> type="text" name="Email" id="Email" placeholder="xxxxxxxx@gmail.com" size="20" maxlength="30" /></td>
  53. <td><div id="errMail"></div></td>
  54. </tr>
  55. <tr>
  56. <td><label>Password (up to 10 digits)</label></td>
  57. <td><input onkeypress="CheckPass()" style="width: 300px " class="w3-input w3-border w3-round-xxlarge" type="text" name="password" id="password" size="20" /></td>
  58. <td><div id="errPassword"></div></td>
  59. </tr>
  60. <%--<tr>
  61. <td><div id="PassStrength"></div></td>
  62. </tr>--%>
  63.  
  64. <tr>
  65. <td><button type="button" onclick="PassStrength()">Wanna test your password? press here</button></td>
  66. <td>Password strength: </td>
  67. <td><div style="margin-left: 0px " id="PassStrength"></div></td>
  68. </tr>
  69. <tr><td></td></tr> <tr><td></td></tr>
  70. <tr>
  71. <td><label>Confirmation questions:</label></td>
  72. </tr>
  73. <tr><td></td></tr>
  74. <tr>
  75. <td><label>What is your father's name?</label></td>
  76. <td><input onkeypress="CheckFather()" type="text" name="fatherName" id="fatherName" class="w3-input w3-border w3-round-xxlarge" size="30" /></td>
  77. <td><div id="errFather"></div></td>
  78. </tr>
  79. <tr>
  80. <td><label>When were you born?</label></td>
  81. <td><input onblur="AgeCheck2()" type="date" name="BDay" id="BDay" class="w3-input w3-border w3-round-xxlarge" <%--size--%>="30" /></td>
  82. <td><div id="errBDay"></div></td>
  83. </tr>
  84. <tr>
  85. <td><label>What is your mother's name?</label></td>
  86. <td><input onkeypress="CheckMother()" type="text" name="motherName" id="motherName" class="w3-input w3-border w3-round-xxlarge" size="20" /></td>
  87. <td><div id="errMother"></div></td>
  88. </tr>
  89. <tr>
  90. <td><label>Phone number</label></td>
  91. <td><input onkeypress="CheckPhone()" style="width: 300px " class="w3-input w3-border w3-round-xxlarge" type="text" id="Phone_Number" name="Phone_Number" placeholder="054-2533409" maxlength="13" size="20" /></td>
  92. <td><div id="errPhone"></div></td>
  93. </tr>
  94. <tr>
  95. <td><div style="margin-left: 20px; border-radius: 15px 40px; " class="g-recaptcha" data-sitekey="6LfbOosUAAAAAPpDdCjPOHyk-yQ0GSXDj6Fz9td4" "></div></td>
  96. <%--<td><button class="g-recaptcha" data-sitekey="6LfbOosUAAAAAPpDdCjPOHyk-yQ0GSXDj6Fz9td4" data-callback="YourOnSubmitFn">Captcha</button></td>--%>
  97. <td><div id="errCapatcha">Plase fill the captcha form</div></td>
  98. </tr>
  99.  
  100. </table>
  101.  
  102. <p class="buttons3">
  103. <input class="buttons3" type="submit" value="Submit" name="submit" id="Submit" onclick="alert('Thanks for registering')" />
  104. <input class="buttons3" type="reset" value="reset" id="reset" onclick="alert('You can now fill the from again')"/>
  105. <input class="buttons3" type="button" onclick="alert('Hello there! Have a nice day!')" value="Click me and get a suprise!"/>
  106. </p>
  107.  
  108. </form>
  109.  
  110. <p class="warning">If you click the "Submit" button, you will be taken to a Personal Data Form. <br/>
  111. In addiotion, all the data you entered will be saved in our data base.</p>
  112.  
  113.  
  114. <%
  115. if (Request.Form["submit"] != null)
  116. {
  117.  
  118. //string name = Request.Form["First_Name"];
  119. //string name2 = Request.Form["Last_Name"];
  120. //string phone_num = Request.Form["Phone_Number"];
  121. //string password = Request.Form["password"];
  122. //string email = Request.Form["Email"];
  123. //string father = Request.Form["fatherName"];
  124. //string mother = Request.Form["motherName"];
  125. //string BDay = Request.Form["BDay"];
  126.  
  127. Session["name"] = Request.Form["First_Name"].ToString();
  128. Session["name2"] = Request.Form["Last_Name"].ToString();
  129. Session["password"] = Request.Form["password"].ToString();
  130. Session["phone_num"] = Request.Form["Phone_Number"].ToString();
  131. Session["Email"] = Request.Form["Email"].ToString();
  132. Session["father"] = Request.Form["fatherName"].ToString();
  133. Session["mother"] = Request.Form["motherName"].ToString();
  134. Session["BDay"] = Request.Form["BDay"].ToString();
  135.  
  136.  
  137. if (ADOhelper.IsNewUser( (string)Session["phone_num"] /*, password)*/ ))
  138. {
  139. // string insert = "";
  140. // insert += $"INSERT INTO tblSignedUsers VALUES('{name}', '{name2}', '{phone_num}', '{email}', '{password}', '{BDay}', '{father}', '{mother}', '{city}', '{blood_type}', '{notes}')";
  141.  
  142.  
  143. // if (ADOhelper.Insert(phone_num, password))
  144. // Response.Write("User signed in successfuly!");
  145. // else
  146. // {
  147. // Response.Write($"Sory {name}, but we failed to log you in. <br />");
  148. // }
  149. //}
  150. //else
  151. // Response.Write("id or password don't appear in the system");
  152. Response.Redirect("/Pages2/PersonalData.aspx");
  153. }
  154. else
  155. {
  156. Response.Write("This phone number is already registered in the system");
  157. }
  158. }
  159. %>
  160.  
  161. </body>
  162. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement