cearlp Posted January 15 Share Posted January 15 Validate function is within a <script language=javascript> and is ----- function Validate() { if (document.form1.password.value == "zxyzz") { window.location="<?php echo 'disp.php'; ?>"; return(false); } else { window.location="<?php echo 'displess.php'; ?>"; return(false); } } Body is--- <body onload="self.focus();document.form1.password.focus()" > <form name= "form1" method="post" onsubmit="return Validate()"> <table width="1000" border="0" cellspacing="1" cellpadding="0"> <tr> <td align= "right">Password: </td> <td><input size="20" maxlength="20" name="password" value'" "></td> </tr> </table> </form> </body> Problem is that under Firefox it always goes to displess.php but under Safari typing in zxyzz it goes to disp.php, anything else goes to displess.php Any suggestions or evidence of errors will be appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/326524-php-form-coding-works-on-safari-but-not-on-firefox/ Share on other sites More sharing options...
Moorcam Posted Wednesday at 01:55 AM Share Posted Wednesday at 01:55 AM The password value here: <input size="20" maxlength="20" name="password" value'" "> This is wrong. You have a single quote before the double quote. This can lead to issues in different browsers. Quote Link to comment https://forums.phpfreaks.com/topic/326524-php-form-coding-works-on-safari-but-not-on-firefox/#findComment-1647966 Share on other sites More sharing options...
gizmola Posted Wednesday at 11:27 PM Share Posted Wednesday at 11:27 PM Can you put your code in a code block in the future? Reading/looking at double spaced code without proper indentation or color syntax highlighting wastes everyone's time and effort and greatly decreases the final results. Notice @Moorcam helpful reply to you where he put an offending line into a proper block where the issue is easy to identify. 1 Quote Link to comment https://forums.phpfreaks.com/topic/326524-php-form-coding-works-on-safari-but-not-on-firefox/#findComment-1648028 Share on other sites More sharing options...
Random8 Posted Thursday at 11:53 AM Share Posted Thursday at 11:53 AM And hopefully there is more to the authentication than this... either browsing directly to disp.php or viewing the source and seeing the password will allow access to your 'secured' content Quote Link to comment https://forums.phpfreaks.com/topic/326524-php-form-coding-works-on-safari-but-not-on-firefox/#findComment-1648057 Share on other sites More sharing options...
Moorcam Posted Thursday at 11:56 AM Share Posted Thursday at 11:56 AM 1 minute ago, Random8 said: And hopefully there is more to the authentication than this... either browsing directly to disp.php or viewing the source and seeing the password will allow access to your 'secured' content It would be interesting to see the full code for authentication. Quote Link to comment https://forums.phpfreaks.com/topic/326524-php-form-coding-works-on-safari-but-not-on-firefox/#findComment-1648058 Share on other sites More sharing options...
cearlp Posted 9 hours ago Author Share Posted 9 hours ago Sorry about the code block. I'm also sorry that by not using a code block I made a mistake in the coding I showed. There is no single quote in the line <td><input size="20" maxlength="20" name="password" value'" "></td> It is a fat finger on my typing. It is as shown but without the single quote after value. I couldn't drag a file or even part of a file because the program code is not on this machine. Quote Link to comment https://forums.phpfreaks.com/topic/326524-php-form-coding-works-on-safari-but-not-on-firefox/#findComment-1648285 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.