|
Posted by J.O. Aho on 07/30/05 14:05
Cooper wrote:
> Hello,
> i have a bit problem. So, is possible put a "POST" value in header into a
page? i have a form with POST method, as for example:
>
> $variabile = contenuto;
>
> <form action="pagina.php" method="post">
> <input type="hidden" name="miavariabile" value="$variabile" />
> </form>
>
> but i don't want set the value of $variabile in a HTML line; i want to pass
this value every for POST method loading it in header at page and to allow to
read this value using:
>
> $myvar = $_POST["miavariabile"]
>
> i hope that as explained ok, so, some help for solve this problem?
> thank you,
> Cooper.
>
> PS: Sorry for my english.
>
>
--- page1.php ---
<html>
<head>
<title>page1</title>
</head>
<body>
<?PHP
$variabile1 = "contenuto";
$variabile2 = "ende";
?>
<form action="page2.php" method="post">
<input type="hidden" name="miavariabile" value="<?PHP echo $variabile1; ?>">
<input type="submit" value="<?PHP echo $variabile1; ?>">
</form>
<br>
<form action="page2.php" method="post">
<input type="hidden" name="miavariabile" value="<?PHP echo $variabile2; ?>">
<input type="submit" value="<?PHP echo $variabile2; ?>">
</form>
<body>
</html>
--- eof --
--- page2.php ---
<html>
<head>
<?PHP $myvar = $_POST["miavariabile"]; ?>
<title>page2 - <?PHP echo $myvar; ?></title>
</head>
<body>
The option chosen by the user was <?PHP echo $myvar; ?>
</body>
</html>
--- eof ---
???
//Aho
Navigation:
[Reply to this message]
|