al3x8730 Posted September 8, 2008 Share Posted September 8, 2008 If I have a form setup, and it has a function... Is there anyway that I can get the same result as entering something into the form, by a URL? Link to comment https://forums.phpfreaks.com/topic/123240-link-to-something-a-form-would-otherwise-do/ Share on other sites More sharing options...
r-it Posted September 8, 2008 Share Posted September 8, 2008 i think you are talkin about the GET method, am not sure, please provide code for more clarity Link to comment https://forums.phpfreaks.com/topic/123240-link-to-something-a-form-would-otherwise-do/#findComment-636460 Share on other sites More sharing options...
al3x8730 Posted September 8, 2008 Author Share Posted September 8, 2008 i think you are talkin about the GET method, am not sure, please provide code for more clarity form example: <form action="process.php" method="post"> Username:<br /> <input type="text" maxlength="16" name="username" /><br /> <input type="submit" value="Get User Information" /> </form> process.php(not the whole thing...): <?php $username = $_POST['username']; $filename = "users/".$username.".php"; if (file_exists($filename)) { include($filename); } else { echo "No such user exists"; } ?> I cut a lot out, that's just an example, basically how can I make a URL that will display process.php As if they entered $username? Link to comment https://forums.phpfreaks.com/topic/123240-link-to-something-a-form-would-otherwise-do/#findComment-636822 Share on other sites More sharing options...
revraz Posted September 8, 2008 Share Posted September 8, 2008 Change method="post" to "get" Then use $_GET on your process.php page to retrieve the variables passed in the URL. Link to comment https://forums.phpfreaks.com/topic/123240-link-to-something-a-form-would-otherwise-do/#findComment-636823 Share on other sites More sharing options...
al3x8730 Posted September 8, 2008 Author Share Posted September 8, 2008 Change method="post" to "get" Then use $_GET on your process.php page to retrieve the variables passed in the URL. I don't get it. I want to keep the form and everything, I just want to know if there's way that I could make an auto generating link. I just need to know how the construction of the URL would be. Link to comment https://forums.phpfreaks.com/topic/123240-link-to-something-a-form-would-otherwise-do/#findComment-636828 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.