Jump to content

$_SERVER['PHP_SELF']; error


adi_das

Recommended Posts

I have a code built in, which is in my localhost and connects to an external database. I have set my connections right, and when I try to login via the page, after pressing submit, my url changes to

localhost/<? echo $_SERVER['PHP_SELF']; ?>?action=validate

 

And I get this displayed.

Quote

 

    Access forbidden!

 

    You don't have permission to access the requested object. It is either read-protected or not readable by the server.

 

    If you think this is a server error, please contact the webmaster.

 

 

where validate is for validating. Any help?

Link to comment
Share on other sites

You shoudn't be using $_SERVER['PHP_SELF'] as a form action to begin with. It is a known XSS vulnerability. Use action="" to submit a form to itself. And while you're at it, don't use short <? open tags, use the full <?php tag syntax, since that's probably the cause of this particular problem.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.