Problem with passing an argument to a php script

I’m fairly new to php, though I have been dabbling with software for many years. I am currently playing with a php script to display data from a big SQL database of dog pedigrees, but I have come across an odd problem.
When I pass an argument to the script with a string which includes ‘tar%20’ ie ‘tar’ and a space in it such as ‘star prize’…

…/card.php?name=star%20prize

I get an error from the server…

Forbidden

You don’t have permission to access /card.php on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Any suggestions please?

Simon R.

Values passed in the url will show up url encoded, php should handle that automagically.

Your error is thrown because the web server doesn’t have access to the file /card.php

… except that the script handles any other arguments sent to card.php without problem. Actually I think I’ve sorted the problem - an over zealous security rule on the server trying to block .tar access.

Simon R.

Ah, didn’t get that from the first post but now I see it was spesifically when sending in a string with “tar”. ^^

That sounds like a strange rule indeed, one of the reasons using a WAF isn’t the best idea.

Great that you got it sorted though :slight_smile:

Sponsor our Newsletter | Privacy Policy | Terms of Service