Problem with reading form input that contains url

Discussion in 'HTML & Website Design' started by dreteh, Feb 24, 2010.

  1. #1
    dreteh, Feb 24, 2010 IP
  2. LeetPCUser

    LeetPCUser Peon

    Messages:
    711
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can take off the http:// in the response and leave the url like www.site.com and then do this in php, at the top of the page. Also, I recommend using a post variable.

    
    <?php header('location: '.$_GET['userinput']); ?>
    
    Code (markup):
     
    LeetPCUser, Feb 24, 2010 IP
  3. dreteh

    dreteh Member

    Messages:
    514
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    33
    #3
    Thanks LeetPCUser for your reply.

    But in my case, I need both to include "http://" and to use GET method.

    Anyone else might know? Thanks.
     
    dreteh, Feb 25, 2010 IP
  4. dreteh

    dreteh Member

    Messages:
    514
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    33
    #4
    Here is my example:
    Try search "http://www.google.com"(without quotes) on my blog (www.bloggergps.com),
    it gets redirected to the front page.

    I tested on some other sites with that theme. They work fine.

    I think the problem come from my web hosting. I am currently hosted on hostgator.

    Does any hostgator subscribers have this sort of problem? Thank you.
     
    dreteh, Mar 12, 2010 IP