form processing inq

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
robin1
Forum Newbie
Posts: 20
Joined: Thu Aug 01, 2002 4:36 pm

form processing inq

Post by robin1 »

Hello everybody,

I'm looking for little help with form processing. I found alot of information on this subject and have a good understanding of how it works interms of checking the form fields. what i cant find is a example/tutorial on form processing whereby if a correction is needed, the form would return after submittion button with the information entered so the user wouldn't have to re-enter the entire form information again.

If anyone seen a good tutorial or maybe a posting on this site, could you please let me know.
Thanks
Robin
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

e.g.

Code: Select all

<html><body>
<?php // php-version >= 4.1
function postedVal($idx)
{
	echo isset($_POSTї$idx]) ? htmlentities($_POSTї$idx]) : '';
}
echo '<pre>'; print_r($_POST); echo '</pre>';
?>
<form method="POST" action="<?php echo $_SERVERї'PHP_SELF']; ?>">
	a<input type="text" name="a" value="<?php postedVal('a'); ?>" /><br/>
	b<input type="text" name="b" value="<?php postedVal('b'); ?>" /><br/>
	c<input type="text" name="c" value="<?php postedVal('c'); ?>" /><br/>
	<input type="submit" />
</form>
</body></html>
Post Reply