jx2012 Posted May 18, 2012 Share Posted May 18, 2012 Hi I am trying to use 2 codes to get a url link. code1 (test.php): <form action="test1.php" method="GET" /> link: <input type="text" name="link" /><br /> <input type="submit" value="Submit" /> </form> code2 (test1.php) <?php $link = $_GET['link']; echo $link; ?> If I input a link as a text such as "Yahoo" it works. But if I input a link as "http://yahoo.com", it didn't work . Quote Link to comment https://forums.phpfreaks.com/topic/262719-how-to-get-a-url-from-_get/ Share on other sites More sharing options...
smoseley Posted May 18, 2012 Share Posted May 18, 2012 $link = urldecode($_GET['link']); Quote Link to comment https://forums.phpfreaks.com/topic/262719-how-to-get-a-url-from-_get/#findComment-1346519 Share on other sites More sharing options...
jx2012 Posted May 19, 2012 Author Share Posted May 19, 2012 not work Quote Link to comment https://forums.phpfreaks.com/topic/262719-how-to-get-a-url-from-_get/#findComment-1346918 Share on other sites More sharing options...
Pikachu2000 Posted May 20, 2012 Share Posted May 20, 2012 What about it "not work"? Quote Link to comment https://forums.phpfreaks.com/topic/262719-how-to-get-a-url-from-_get/#findComment-1346930 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.