Get Variable in URL losing Page?

Discussion in 'PHP' started by mokimofiki, May 26, 2012.

  1. #1
    This is an odd error as I can load a url with a value in it and have it return the correct information with only the hosting domain as value.

    Here is the example:
    This works and loads the page: http://www.mofiki.com/wp-apps/wp-free-backlinks/get-stats.php?domain=http://www.mofiki.com
    This will not work and gives 404: http://www.mofiki.com/wp-apps/wp-free-backlinks/get-stats.php?domain=http://www.anyotherdomain.com

    The file get-stats.php simply looks for the domain using get within a mysql database and returns some numbers. I would understand if it was giving me a mysql_error although everything besides http://www.mofiki.com gives a 404 page. ( I would assume even on error that the page would still exist as get-stats.php is a static file.

    Thank you in advance,
    Brandon
     
    mokimofiki, May 26, 2012 IP
  2. rainborick

    rainborick Well-Known Member

    Messages:
    424
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    120
    #2
    There could be a bug in your script, of course. It could also be that your hosting service blocks some external HTTP requests from PHP scripts. You might contact their customer service and ask them about it. Good luck!
     
    rainborick, May 26, 2012 IP
  3. mokimofiki

    mokimofiki Well-Known Member

    Messages:
    444
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    130
    #3
    Got it. I'm not sure why I didn't think of it before but the http:// in the variable is causing it to break with anything besides the hosting domain breaks. When stripping the http:// and then just adding it back to the script before the query all works fine.
     
    mokimofiki, May 29, 2012 IP