Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Incorrect login error IE only

  1. #1
    Join Date
    Dec 2008
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Red face Incorrect login error IE only

    Hi all,
    I'm new to this site (and coding this complex) and was wondering if someone could help me....

    Ok the website is
    http://shootus.com.au/

    I am having an issue with logging in on IE with an incorrect password. I have been told it is something to do with

    line 329
    character 5
    document.getElementById('logform').innerHTML

    and something to do with "names"....


    I can post the code but i'm not sure really what code to post and to post it all might be exsessive, any help is really appriciated guys.


    thanks in advance

  2. #2
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    Quote Originally Posted by redpanda View Post
    I am having an issue with logging in on IE with an incorrect password.
    What exactly do you mean by that? Can you log in even with an incorrect password?

  3. #3
    Join Date
    Dec 2008
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Sorry, i'm an idiot i just realised how bad that first post was. What i should of said is....

    When logging in with an incorrect password in IE it hangs on the "checking" part of the process but won't login. With a correct password it works like it should.

    Hope this helps and sorry i didn't explain it well to start with.

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    That may or may not be. However, in IE 7, there is an error here:

    Code:
    <script>
    //XMLhttp variable will hold the XMLHttpRequest object
    
    var xmlhttps = false;
            
    // If the user is using Mozilla/Firefox/Safari/etc
    if (window.XMLHttpRequest) {
            //Intiate the object
            xmlhttps = new XMLHttpRequest();
            //Set the mime type
            xmlhttps.overrideMimeType('text/xml');
    }
    // If the user is using IE
    else if (window.ActiveXObject) {
            //Intiate the object
            xmlhttps = new ActiveXObject('Microsoft.XMLHTTP');
    }
    </script>
    because IE 7 supports the window.XMLHttpRequest object, but not xmlhttps.overrideMimeType object. To correct that:

    Code:
    <script>
    //XMLhttp variable will hold the XMLHttpRequest object
    
    var xmlhttps = false;
            
    // If the user is using Mozilla/Firefox/Safari/etc
    if (window.XMLHttpRequest) {
            //Intiate the object
            xmlhttps = new XMLHttpRequest();
            //Set the mime type
            if (xmlhttps.overrideMimeType)
                    xmlhttps.overrideMimeType('text/xml');
    }
    // If the user is using IE
    else if (window.ActiveXObject) {
            //Intiate the object
            xmlhttps = new ActiveXObject('Microsoft.XMLHTTP');
    }
    </script>
    That code has other issues in some browsers. Though just that much should get it working in those that support one of those two methods.

    This may be the only error for IE, but there could be others.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Dec 2008
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks, i am going to try it now and will let everyone know what happens,

    Cheers

  6. #6
    Join Date
    Dec 2008
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs down

    Sorry mate, no such luck, it's still hanging on the checking part of the process if the wrong password is entered.

    Someone said it might be to do with this following line (in bold)


    Code:
    function loginChk() {
            //Put the form data into a variable
    	var username = document.getElementById('username').value;
    	var password = document.getElementById('password').value;
    	
            //If the form data is *not* blank, query the DB and return the results
    	if(username !== '' && password != '') {
                    //Change the content of the 'result' DIV to 'Searching...'
                    //This gives our user confidence that the script is working if it takes a moment for the result to be returned. However the user will likely never see this as the result will be returned in an instant...
    		//document.getElementById('fillin').innerHTML = 'Searching...';
    		
                    //This sets a variable with the URL (and query strings) to our PHP script
    		var url = 'chkLogin.php?username=' + username + '&password=' + password;
                    //Open the URL above 'asynchronously'(thats what the 'true' is for) using the GET method
    		xmlhttps.open('GET',   url, true);
                    //Check that the PHP script has finished sending us the result
    		xmlhttps.onreadystatechange = function() {
    			if(xmlhttps.readyState == 4 && xmlhttps.status == 200) {
                                    //Replace the content of the 'result' DIV with the result returned by the PHP script
    				document.getElementById('logForm').innerHTML = xmlhttps.responseText + ' ';
    			} else {
                                    //If the PHP script fails to send a response, or sends back an error, display a simple user-friendly notification
    				document.getElementById('logForm').innerHTML = '<font color="#FFFFFF" face="Verdana"  size="2"><i>Checking....</i></font>';
    			}
    		};
    		xmlhttps.send(null);  
    	}
    	else 
    		document.getElementById('logForm').innerHTML = '<font color="#FF0000" face="Verdana"  size="2"><b>Enter Username and password</b></font>';
    
    }

  7. #7
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Using innerHTML with a form is a no-no of sorts. Potentially it can really confuse the heck out of the browser. But that may or may not be at issue here. It would help to have an idea of how things go if the name and password are correct. In such a case, does the form's innerHTML get replaced, or does something else happen?
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  8. #8
    Join Date
    Dec 2008
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Not sure really how it all works but it logs in alright and everything.

  9. #9
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Is there a guest user and password then, so I can see for myself?
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  10. #10
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    OK, after playing around a bit, this (on http://shootus.com.au/):

    Code:
    <form action="" method="post" name="frmLogin" onsubmit="return checkLogin()">
            <input type="hidden" name="frmAction" value="Login" />                  
    			<div id="logForm"><table width="100%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                  	<td></td>
                    <td width="130">&nbsp;</td>
                    <td class="style9"></td>
                    <td class="style8">&nbsp;Username&nbsp;</td>
                    <td><input name="username" type="text" class="style8" id="username" /></td>
                    <td class="style8">&nbsp;Password&nbsp;</td>
                    <td><input name="password" type="password" class="style8" id="password" /></td>
                    <td>&nbsp;<input name="Submit" type="button" class="style8" value="Submit" onclick="javascript:loginChk()" /></td>
                    <td width="130"></td>
                  </tr>
                  
                  <tr>
                  	<td></td>
                    <td></td>
                    <td></td>
                    <td></td>
     				<td class="style8">&nbsp;<a href="register.php" title="register" rel="gb_page_center[500, 600]">Register here</a> </td>
                    <td></td>
                    <td class="style8">&nbsp;<a href="retrieve_password.php" title="Retrieve Password" rel="gb_page_center[450, 380]">Lost Password?</a></td>
                    <td></td>
    
                  </tr>
              </table></div>
          </form>
    Should be:

    Code:
    <div id="logForm"><form action="" method="post" name="frmLogin" onsubmit="return checkLogin()">
            <input type="hidden" name="frmAction" value="Login" />                  
    			<table width="100%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                  	<td></td>
                    <td width="130">&nbsp;</td>
                    <td class="style9"></td>
                    <td class="style8">&nbsp;Username&nbsp;</td>
                    <td><input name="username" type="text" class="style8" id="username" /></td>
                    <td class="style8">&nbsp;Password&nbsp;</td>
                    <td><input name="password" type="password" class="style8" id="password" /></td>
                    <td>&nbsp;<input name="Submit" type="button" class="style8" value="Submit" onclick="javascript:loginChk()" /></td>
                    <td width="130"></td>
                  </tr>
                  
                  <tr>
                  	<td></td>
                    <td></td>
                    <td></td>
                    <td></td>
     				<td class="style8">&nbsp;<a href="register.php" title="register" rel="gb_page_center[500, 600]">Register here</a> </td>
                    <td></td>
                    <td class="style8">&nbsp;<a href="retrieve_password.php" title="Retrieve Password" rel="gb_page_center[450, 380]">Lost Password?</a></td>
                    <td></td>
    
                  </tr>
              </table>
          </form></div>
    But, depending upon what happens with a successful login, that might or might not work out too well for that. Chances are it will be fine.

    Also, this (on chkLogin.php):

    Code:
    <font color="#FF0000" face="Verdana"  size="2"><b>Invalid Login. Please try again</font><br /><form action="" method="post" name="frmLogin" onsubmit="return checkLogin()">
            <input type="hidden" name="frmAction" value="Login" />                  
                <div id="logResults"></div>
    			<div id="logForm"><table width="100%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                  	<td></td>
                    <td width="130">&nbsp;</td>
                    <td class="style9"></td>
                    <td class="style8">&nbsp;Username&nbsp;</td>
                    <td><input name="username" type="text" class="style8" id="username" /></td>
                    <td class="style8">&nbsp;Password&nbsp;</td>
                    <td><input name="password" type="password" class="style8" id="password" /></td>
                    <td>&nbsp;<input name="Submit" type="button" class="style8" value="Submit" onclick="javascript:loginChk()" /></td>
                    <td width="130"></td>
                  </tr>
                  
                  <tr>
                  	<td></td>
                    <td></td>
                    <td></td>
                    <td></td>
     				<td class="style8">&nbsp;<a href="register.php" title="register" rel="gb_page_center[500, 600]">Register here</a> </td>
                    <td></td>
                    <td class="style8">&nbsp;<a href="retrieve_password.php" title="Retrieve Password" rel="gb_page_center[450, 380]">Lost Password?</a></td>
                    <td></td>
    
                  </tr>
              </table></div>
          </form>
    should be:

    Code:
    <font color="#FF0000" face="Verdana"  size="2"><b>Invalid Login. Please try again</font><br /><form action="" method="post" name="frmLogin" onsubmit="return checkLogin()">
            <input type="hidden" name="frmAction" value="Login" />                  
                <div id="logResults"></div>
    			<table width="100%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                  	<td></td>
                    <td width="130">&nbsp;</td>
                    <td class="style9"></td>
                    <td class="style8">&nbsp;Username&nbsp;</td>
                    <td><input name="username" type="text" class="style8" id="username" /></td>
                    <td class="style8">&nbsp;Password&nbsp;</td>
                    <td><input name="password" type="password" class="style8" id="password" /></td>
                    <td>&nbsp;<input name="Submit" type="button" class="style8" value="Submit" onclick="javascript:loginChk()" /></td>
                    <td width="130"></td>
                  </tr>
                  
                  <tr>
                  	<td></td>
                    <td></td>
                    <td></td>
                    <td></td>
     				<td class="style8">&nbsp;<a href="register.php" title="register" rel="gb_page_center[500, 600]">Register here</a> </td>
                    <td></td>
                    <td class="style8">&nbsp;<a href="retrieve_password.php" title="Retrieve Password" rel="gb_page_center[450, 380]">Lost Password?</a></td>
                    <td></td>
    
                  </tr>
              </table>
          </form>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •