Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="main-container">
- Username:<br>
- <input type="text" name="uname" value="Username">
- <br>
- Password:<br>
- <input type="password" name="pword" value="Password">
- <br><br>
- <input type="submit" value="AddRecord">
- <input type="reset" value="Cancel">
- </div>
- </div>
- </body>
- <script type="text/javascript">
- function AddRecord() {
- var adoConn = new ActiveXObject("ADODB.Connection");
- var adoRS = new ActiveXObject("ADODB.Recordset");
- adoConn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source = C:\Documents\Writings.mdb");
- adoRS.Open("Select * From User", adoConn, 1, 3);
- if(!rs.bof){
- rs.MoveFirst();
- while(!rs.eof){
- var data=rs(1);
- if(data==user.value){
- alert("This user already exists!");
- exists=1;
- }else{
- break;
- rs.movenext();
- }
- }
- }
- if(exists!=1){
- adoRS.AddNew;
- adoRS.Fields("UserName")=user.value;
- adoRS.Update;
- adoRS.Close();
- adoConn.Close();
- alert("User successfully registered!");
- document.cookie=user.value;
- window.location="https://www.google.co.uk";
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement