Jump to content

How to get a url from $_GET


jx2012

Recommended Posts

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 :).

Link to comment
https://forums.phpfreaks.com/topic/262719-how-to-get-a-url-from-_get/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.