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?

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.

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.