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? Quote Link to comment 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 Quote Link to comment 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? Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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.