Jump to content

Link to something a form would otherwise do?


al3x8730

Recommended Posts

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.