Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Registration.aspx.cs" Inherits="DataBaseProject.Pages2.Registration" %>
- <!DOCTYPE html>
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head runat="server">
- <title>Sign-Up</title>
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"/>
- <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css"/>
- <style>
- body {
- background-image: url(Images/Magen_David.jpg);
- background-repeat: no-repeat;
- background-position: center top;
- background-attachment: fixed;
- }
- .buttons3 {
- margin-left: 15px;
- border-radius: 15px 50px;
- }
- .warning {
- margin-left: 15px;
- font-size: 24px;
- font-weight: bold;
- }
- </style>
- <script src="../JS/Registration.js"></script>
- <script src='https://www.google.com/recaptcha/api.js'></script>
- </head>
- <body style="background-image:url(Images/Magen_David.jpg)" onload="Captha()">
- <%--<img src="Images/1200px-Magen_David_Adom.jpg.png" />--%>
- <div class="w3-container w3-red"><h1>Registration</h1></div>
- <form method="post" onsubmit="return AllChecks()" runat="server">
- <table>
- <tr>
- <td><label>First name:</label></td>
- <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>
- <td><div id="errFirstName"></div></td>
- </tr>
- <tr>
- <td><label>Last name:</label></td>
- <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>
- <td><div id="errLastName"></div></td>
- </tr>
- <tr>
- <td><label>E-mail</label></td>
- <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>
- <td><div id="errMail"></div></td>
- </tr>
- <tr>
- <td><label>Password (up to 10 digits)</label></td>
- <td><input onkeypress="CheckPass()" style="width: 300px " class="w3-input w3-border w3-round-xxlarge" type="text" name="password" id="password" size="20" /></td>
- <td><div id="errPassword"></div></td>
- </tr>
- <%--<tr>
- <td><div id="PassStrength"></div></td>
- </tr>--%>
- <tr>
- <td><button type="button" onclick="PassStrength()">Wanna test your password? press here</button></td>
- <td>Password strength: </td>
- <td><div style="margin-left: 0px " id="PassStrength"></div></td>
- </tr>
- <tr><td></td></tr> <tr><td></td></tr>
- <tr>
- <td><label>Confirmation questions:</label></td>
- </tr>
- <tr><td></td></tr>
- <tr>
- <td><label>What is your father's name?</label></td>
- <td><input onkeypress="CheckFather()" type="text" name="fatherName" id="fatherName" class="w3-input w3-border w3-round-xxlarge" size="30" /></td>
- <td><div id="errFather"></div></td>
- </tr>
- <tr>
- <td><label>When were you born?</label></td>
- <td><input onblur="AgeCheck2()" type="date" name="BDay" id="BDay" class="w3-input w3-border w3-round-xxlarge" <%--size--%>="30" /></td>
- <td><div id="errBDay"></div></td>
- </tr>
- <tr>
- <td><label>What is your mother's name?</label></td>
- <td><input onkeypress="CheckMother()" type="text" name="motherName" id="motherName" class="w3-input w3-border w3-round-xxlarge" size="20" /></td>
- <td><div id="errMother"></div></td>
- </tr>
- <tr>
- <td><label>Phone number</label></td>
- <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>
- <td><div id="errPhone"></div></td>
- </tr>
- <tr>
- <td><div style="margin-left: 20px; border-radius: 15px 40px; " class="g-recaptcha" data-sitekey="6LfbOosUAAAAAPpDdCjPOHyk-yQ0GSXDj6Fz9td4" "></div></td>
- <%--<td><button class="g-recaptcha" data-sitekey="6LfbOosUAAAAAPpDdCjPOHyk-yQ0GSXDj6Fz9td4" data-callback="YourOnSubmitFn">Captcha</button></td>--%>
- <td><div id="errCapatcha">Plase fill the captcha form</div></td>
- </tr>
- </table>
- <p class="buttons3">
- <input class="buttons3" type="submit" value="Submit" name="submit" id="Submit" onclick="alert('Thanks for registering')" />
- <input class="buttons3" type="reset" value="reset" id="reset" onclick="alert('You can now fill the from again')"/>
- <input class="buttons3" type="button" onclick="alert('Hello there! Have a nice day!')" value="Click me and get a suprise!"/>
- </p>
- </form>
- <p class="warning">If you click the "Submit" button, you will be taken to a Personal Data Form. <br/>
- In addiotion, all the data you entered will be saved in our data base.</p>
- <%
- if (Request.Form["submit"] != null)
- {
- //string name = Request.Form["First_Name"];
- //string name2 = Request.Form["Last_Name"];
- //string phone_num = Request.Form["Phone_Number"];
- //string password = Request.Form["password"];
- //string email = Request.Form["Email"];
- //string father = Request.Form["fatherName"];
- //string mother = Request.Form["motherName"];
- //string BDay = Request.Form["BDay"];
- Session["name"] = Request.Form["First_Name"].ToString();
- Session["name2"] = Request.Form["Last_Name"].ToString();
- Session["password"] = Request.Form["password"].ToString();
- Session["phone_num"] = Request.Form["Phone_Number"].ToString();
- Session["Email"] = Request.Form["Email"].ToString();
- Session["father"] = Request.Form["fatherName"].ToString();
- Session["mother"] = Request.Form["motherName"].ToString();
- Session["BDay"] = Request.Form["BDay"].ToString();
- if (ADOhelper.IsNewUser( (string)Session["phone_num"] /*, password)*/ ))
- {
- // string insert = "";
- // insert += $"INSERT INTO tblSignedUsers VALUES('{name}', '{name2}', '{phone_num}', '{email}', '{password}', '{BDay}', '{father}', '{mother}', '{city}', '{blood_type}', '{notes}')";
- // if (ADOhelper.Insert(phone_num, password))
- // Response.Write("User signed in successfuly!");
- // else
- // {
- // Response.Write($"Sory {name}, but we failed to log you in. <br />");
- // }
- //}
- //else
- // Response.Write("id or password don't appear in the system");
- Response.Redirect("/Pages2/PersonalData.aspx");
- }
- else
- {
- Response.Write("This phone number is already registered in the system");
- }
- }
- %>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement