4
$url = $_GET['url'];
echo "$url";

and I request /test.php?url=ok

gives me ok as output..

but I use a url test.php?url=http://google.com

gives me 403- Forbidden error.. I donno why it's not working ..

Please help me..

2
  • It works fine for me. Is this your entire script? Commented Jul 19, 2010 at 5:16
  • 1
    possible duplicate of Unable to send Url in a Form field Commented Jul 19, 2010 at 5:21

3 Answers 3

8

This is often caused by overcautious settings of mod_security, an Apache extension. You'll have to consult your provider. (But they usually disable this individually or relax the settings.)

Sign up to request clarification or add additional context in comments.

Comments

1

Since characters like : and / etc are special characters in URLs, you cannot use them as part of a query string like that. You need to encode what you are passing in as a URL - in php that is done by the urlencode function, and will look like this:

test.php?url=http%3A%2F%2Fgoogle.com

1 Comment

Improper escaping is unlikely to cause a 403.
0

I added SecFilterEngine Off to .htaccess . and it solved the problem it's basically mod_security .

2 Comments

na I'd say it would be fair to accept @mario's answer here - after all, he came up with the idea.
Thanks..I am new to this site..I am getting used :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.