[PHP 5.0] save HTML form to .php file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



My HTML form submits data to a php form and the php form displays it.
I was wondering if I could "save" the data in the php form so whoever
opens it can see the data. At the moment, if I open "action.php" from
a different computer or browser I see "hi you are 0 years old"

Here's my HTML & PHP form -

<html>

<head> </head>

<title> Form </title>

<body>

<form action="action.php" method="post">
<p> your name: <input type="text" name="name" /> </p>
<p> your age: <input type="text" name="age" /> </p>
<p> <input type="submit" /> </p>
</form>
</body>
</html>

PHP form -

hi <?php echo htmlspecialchars($_POST['name']); ?>
you are <?php echo (int)$_POST['age']; ?> years old

Thanks.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux