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
https://forums.phpfreaks.com/topic/225855-_serverphp_self-error/
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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.