php goto

I need some code to help me

I have a textbox(value of 250)

I want whatever is in textbox to go at the end of a url
eg

http://localhost/test.php?clientID=textbox(250)
LVL 2
beridiusAsked:
Who is Participating?
 
Lukasz ChmielewskiCommented:
Well, not really again, try this:

<label for="textfield">Client ID</label>
      <input type="text" name="searchclient" id="searchclient" method="post" action="search-client.php" />
      <input type="submit" name="button" id="button" value="Search" />
    </form>

Open in new window


<?php

$clientsearch = $_POST['searchclient'];
$_SESSION['clientsearch']=$clientsearch;


if ($clientsearch!=""){
	
	header('location: http://localhost/Client-detail.php?clientID='.$clientsearch);
}
?>

Open in new window


The $_POST array needs to have the names from the "name" attribute from the form
0
 
DerokorianCommented:
<form action="test.php" method="get">
   <input type="text" name="clientID">
   <input type="submit" value="Submit">
</form>

Open in new window



Is this what you are looking for? when you press submit you will get the outcome you are looking for...
0
 
beridiusAuthor Commented:
not realy

<label for="textfield">Client ID</label>
      <input type="text" name="searchclient" id="searchclient" method="post" action="search-client.php" />
      <input type="submit" name="button" id="button" value="Search" />
    </form>

Open in new window


then on search-client.php

<?php

$clientsearch = $_POST['clientsearch'];
$_SESSION['clientsearch']=$clientsearch;


if ($clientsearch!=""){
	
	header('location: http://localhost/Client-detail.php?clientID=',$clientsearch);
}



?>

Open in new window

0
 
Lukasz ChmielewskiCommented:
if ($clientsearch!=""){
      
      header('location: http://localhost/Client-detail.php?clientID='.$clientsearch);
}
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.