Let's suppose I have an application with several formularies, before submitting the formulary the user can check what he has introduced, all non-sensible information in those formularies that was given before by the user must be filled automatically. I've tried doing it this way:
<?php
if ($_POST['enviar'])
{
echo (nl2br("Button pressed\n"));
echo(nl2br("The content of texto is ".$_POST['texto']."\n"));
print '<a href=otro.php>Return to form</a>';
}
else {
$temp=$_POST['texto'];
print '<form action="otro.php" method="post">
<input type="submit" name="enviar">
<input type="text" name="texto" value="$temp">
<input type="text" name="texto2">';
}
?>
So the field text would take the value $_POST['texto'] always the form gets an instance, but the html page prints $temp literally in the textbox instead, sigh.
I'm not too sure if the $_POST['texto'] keeps the info after pressing the link to go back to the form. So, I'd better just put the form info into a temp file and get the info from that file later. Anyway how I'm supposed to tell the html page that it takes that value by default?
Thanks in advance.
<?php
if ($_POST['enviar'])
{
echo (nl2br("Button pressed\n"));
echo(nl2br("The content of texto is ".$_POST['texto']."\n"));
print '<a href=otro.php>Return to form</a>';
}
else {
$temp=$_POST['texto'];
print '<form action="otro.php" method="post">
<input type="submit" name="enviar">
<input type="text" name="texto" value="$temp">
<input type="text" name="texto2">';
}
?>
So the field text would take the value $_POST['texto'] always the form gets an instance, but the html page prints $temp literally in the textbox instead, sigh.
I'm not too sure if the $_POST['texto'] keeps the info after pressing the link to go back to the form. So, I'd better just put the form info into a temp file and get the info from that file later. Anyway how I'm supposed to tell the html page that it takes that value by default?
Thanks in advance.