Hi, I have a GET method form with one input field for user to enter an url, including "http://". When the form is submitted, an error page is showing up because the url in the address bar is having two "http://"s. Here is the example: http://www.mywebsite.com/processform.php?userinput=http://www.userswebsite.com How do I solve this problem? Thank you.
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):
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.
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.