Jump to content

Recommended Posts

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.

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.

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.

  • Thanks 1
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.

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. 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.