NYCPHP Meetup

NYPHP.org

[nycphp-talk] Managing form data with PHP

John Campbell jcampbell1 at gmail.com
Tue Dec 11 13:47:26 EST 2007


> The 'pretty' enhancements are relatively easy - but I'm having a
> problem trying to get the form data to redisplay.

Start by submitting the form to the script that renders the page:
<form action="" method="post">
Then each field should of the form:
<input type="text" name="username" value="<?php echo
htmlspecialchars($_POST['username']); ?>" />

If the post data is valid, redirect.  Otherwise, the form will
automatically redisplay with the original values intact.



More information about the talk mailing list