madhushankarox
madhushankarox

Reputation: 1477

PHP $_GET('') issue. Very simple but I can't fix

I'm developing a script to grab some information from an external url. But I'm having issues with my hosting and script is returning "NetworkError: 403 Forbidden" so I did a very simple script to find about this issue and got same result.

when I go to ?url=http://youtube.com or ?url=http://google.com or what ever ?url=url, it is echoing variable value.

but when I'm visiting ?url=http://tiny.cc or ?url=http://adf.ly (found only these two for now), I'm getting "NetworkError: 403 Forbidden" (Discovered with firebug; displaying a blank page)

Thank you.

CODE:

<?php
  $get_url = $_GET['url'];
  if ( isset ( $get_url ) && $get_url != '' )
    echo $get_url;
  else
    echo 'Please enter "?url=anything" at the end of the URL.';
?>

Upvotes: 0

Views: 98

Answers (2)

madhushankarox
madhushankarox

Reputation: 1477

Fixed the issue. Message from my host:

The issue with http:// has been fixed. Our security feature mod_security was blocking the action. I have added an exception. Now it is working.

Upvotes: 0

Vimal Gohel
Vimal Gohel

Reputation: 13

It's not PHP - it's your httpd that returns 403. Please check it.

Upvotes: 1

Related Questions