NYCPHP Meetup

NYPHP.org

[nycphp-talk] Having a form return to itself after "submit"

Henry Ponce henry at beewh.com
Sat Oct 9 16:34:40 EDT 2004


Hello, you can do something similar to this.

I would use one form.
================================
<?
if (isset($_POST["insert_button"])){
	// 1. do all you need to insert to the database
	// 2. you can create messages that are contained in some variable.
	// for example $message
}
if (isset($message)){
	echo $message;
}
?>
<form name="insert_form" action="" method="post">
<?
// all the form elements
?>
	<input type="submit" name="insert_button" value="Insert">
</form>
===============================================
Basically, if $_POST["insert_button"] isn't set then this means that there is 
no need to insert in the database, otherwise the form elements can be 
inserted.

I hope you understand this. It's easy.

Henry



More information about the talk mailing list