soma56 Posted December 22, 2010 Share Posted December 22, 2010 I'm trying to figure out a way to post data directly to a URL. For example: <?php if (isset($_POST["pass"]) && ($_POST["pass"]=="$password")) { echo "You did it"; ?> <?php } else { echo "<form method=\"post\"><p align=\"left\">"; echo "<input name=\"pass\" type=\"text\" size=\"25\" maxlength=\"40\"><input value=\"Enter Pass\" type=\"submit\"></form>"; exit; } ?> Let's assume $password is 'password'. Why can't I simply pass the information through the URL to access the page with something like this: http://mypage.com/the-same-page.php?pass=password Link to comment https://forums.phpfreaks.com/topic/222359-posting-data-directly-in-url/ Share on other sites More sharing options...
trq Posted December 22, 2010 Share Posted December 22, 2010 Data passed through the url belongs to $_GET. They are two different request types. Link to comment https://forums.phpfreaks.com/topic/222359-posting-data-directly-in-url/#findComment-1150184 Share on other sites More sharing options...
soma56 Posted December 22, 2010 Author Share Posted December 22, 2010 Thanks. I understand now. I suppose there is no easy way to do with $_POST? I have several dozen pages to revise now... Link to comment https://forums.phpfreaks.com/topic/222359-posting-data-directly-in-url/#findComment-1150188 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.