Richard already answered the variable part, but I thought I'd point out
that you need to use double quotes in your HTML tags... Single quotes
are incorrect...

<?
echo("<P> 
<FORM method=\"POST\" action=\"join2.php\">
text for button
<INPUT type=\"submit\" value=\"Next step\">
<INPUT type=\"hidden\" name=\"htmlVariableName\"
value=\"$phpVariableName\">
</FORM>
");
?>

Or...

<?
echo('<P> 
<FORM method="POST" action="join2.php">
text for button
<INPUT type="submit" value="Next step">
<INPUT type="hidden" name="htmlVariableName" value="'. $phpVariableName
.'">
</FORM>
");
?>

Or... Better yet, why not just:

<P>
<FORM method="POST" action="join2.php">
text for button
<INPUT type="submit" value="Next step">
<INPUT type="hidden" name="htmlVariableName"
value="<?=$phpVariableName?>">
</FORM>


See the PHP manual for escaping HTML and string literals if you're
confused by any of this..
http://www.php.net/manual/en/language.basic-syntax.php#language.basic-sy
ntax.phpmode
http://www.php.net/manual/en/language.types.string.php



-----Original Message-----
From: Olav Drageset [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, November 17, 2001 1:01 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Transfer variable to next web-page


I just started..

How do you transfer a variable from one web-page to another
I try to use a form like this:
<?
echo("<P> 
<FORM method='POST' action='join2.php'>
text for button
<INPUT type='submit' value='Next step'>
<INPUT type='hidden' name='htmlVariableName' value='$phpVariableName'>
</FORM>
");
?>

and catch it in    join2.php    by:

$phpVariableName=htmlVariableName;

echo"$phpVariableName";

This do not work.
Can anyone tel me what should be done
Neither books, php-manual nor HTML-specification does tel me.

Olav




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to