Posted by J.O. Aho on 12/18/05 10:47
number1.email@gmail.com wrote:
> Hi Aho,
>
> Not sure if I understand this...maybe you can explain it to me. When I
> put this code into index2.php, it displays a "textbox" when this file
> is called from index.php.
>
> What I'd like to do is have only index.php prompt for the username, and
> pass this to index2.php. When I click on the Submit Button on
> index2.php, I'd like to pass this username back to index.php (ie: via
> the ?username option as you mentioned previously).
>
> Is there a way to buildup this HTML Tag:
>
> <FORM action="index.php?username=123" method="post"><BR>
>
> via code...perhaps via sprintf, so that a %s is used to pass in the
> exact value of the username variable when control is passed back to
> index.php?
>
> Perhaps I'm missing something. Thanks for all your help with this.
<form action="index.php" method="post">
<input type="hidden" name="username" value="<?PHP echo $username; ?>">
<input type="submit" value="Back to index1">
</form>
This requires that you already have transferred the username from $_REQUEST to
$username.
//Aho
[Back to original message]
|