Created
April 7, 2012 02:08
-
-
Save wilornel/2324492 to your computer and use it in GitHub Desktop.
Some register function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //the Function: | |
| // register.php is just: <?php echo "ok" ?> | |
| function registerR(){ | |
| // alert ('works1'); | |
| var ajaxRequest3; | |
| if (window.XMLHttpRequest) | |
| { | |
| // alert('works2'); | |
| ajaxRequest3 = new XMLHttpRequest(); | |
| } | |
| else | |
| { | |
| ajaxRequest3 = new ActiveXObject("Mictosoft.XMLHTTP"); | |
| } | |
| // alert ('works3'); | |
| ajaxRequest3.onreadystatechange = function(){ | |
| if(ajaxRequest3.readyState == 4){ | |
| if(ajaxRequest3.responseText == "ok"){ | |
| document.getElementById('regspan').innerHTML = "Registration was a success! You can now Log in."; | |
| alert ('works5a'); | |
| } | |
| else{ | |
| document.getElementById('regspan').innerHTML = "Registration Failed."; | |
| alert (ajaxRequest3.responseText); | |
| } | |
| } | |
| } | |
| // alert ('works4'); | |
| var username = document.getElementById('user1').value; | |
| var password1 = document.getElementById('pass1').value; | |
| var password2 = document.getElementById('pass2').value; | |
| var query = "?usernameR=" +username +"&passwordR1=" +password1 +"&passwordR2=" +password2; | |
| ajaxRequest3.open("GET", "register.php" +query, true); | |
| ajaxRequest3.send(null); | |
| alert ("register.php" +query); | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment