Using PHP form - only show data after submit is triggered
by pizzipie from LinuxQuestions.org on (#4W98X)
How can I stop the high-lighted text from showing when form loads. I only
want to see it and the associated data afterthe form is submitted.
Thanks in advance for help.
Code:<!DOCTYPE html>
<html>
<body>
<form action="" method="post"><!-- myform.php -->
<p>Your Name: <input type="text" name="yourname" /><br />
E-mail: <input type="text" name="email" /></p>
<p>Do you like this website?
<input type="radio" name="likeit" value="Yes" checked="checked" /> Yes
<input type="radio" name="likeit" value="No" /> No
<input type="radio" name="likeit" value="Not sure" /> Not sure</p>
<p>Your comments:<br />
<textarea name="comments" rows="10" cols="40"></textarea></p>
<p><input type="submit" value="Send it!"></p>
</form>
Your name is: <?php echo $_POST['yourname']; ?><br />
Your e-mail:<?php echo $_POST['email']; ?><br />
<br />
Do you like this website? <?php echo $_POST['likeit']; ?><br />
<br />
Comments:<br />
<?php echo $_POST['comments']; ?>
</body>
</html>
Attached Thumbnails


want to see it and the associated data afterthe form is submitted.
Thanks in advance for help.
Code:<!DOCTYPE html>
<html>
<body>
<form action="" method="post"><!-- myform.php -->
<p>Your Name: <input type="text" name="yourname" /><br />
E-mail: <input type="text" name="email" /></p>
<p>Do you like this website?
<input type="radio" name="likeit" value="Yes" checked="checked" /> Yes
<input type="radio" name="likeit" value="No" /> No
<input type="radio" name="likeit" value="Not sure" /> Not sure</p>
<p>Your comments:<br />
<textarea name="comments" rows="10" cols="40"></textarea></p>
<p><input type="submit" value="Send it!"></p>
</form>
Your name is: <?php echo $_POST['yourname']; ?><br />
Your e-mail:<?php echo $_POST['email']; ?><br />
<br />
Do you like this website? <?php echo $_POST['likeit']; ?><br />
<br />
Comments:<br />
<?php echo $_POST['comments']; ?>
</body>
</html>
Attached Thumbnails