Jump to content

Form input into a redirect?


Michdd

Recommended Posts

Is there some way that I can make a submit form that will directly place the person at a certain url based on what they entered. What I'm trying to do is more complicated than this, but this is just an example of what I want to do.

 

Have a submit form and when they type in say "11" into it, and press submit, it directly brings him to like somefile.php?id=11

Link to comment
https://forums.phpfreaks.com/topic/134302-form-input-into-a-redirect/
Share on other sites

Yes.

 

<?php
$textfield = $_POST["textfield"];
header("Location: ./somefile.php?id=$textfield";
?>

I knew that already, that won't do what I want it to do, because this is involved in a complicated script, so when it submits the form, since a certain variable isn't already set, it doesn't even get to the if(isset($textfield)){ } So it won't do that.

 

I knew that already, that won't do what I want it to do, because this is involved in a complicated script, so when it submits the form, since a certain variable isn't already set, it doesn't even get to the if(isset($textfield)){ } So it won't do that.

 

Now that is one hell of a run-on sentence

after re-reading it several times I think this is the answer from what I deciphered: put if(isset($certainvarable) { if(isset($textfield) } } else { //error
}

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.