RE: Quick Question re: Input

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

 



[snip]
<form method="post" name="form1" action="<?php echo addrecord(); ?> ">
[/snip]

Unfortunately you cannot do it like this, you either have to reload the
page or send the processing to another namespace. But you can do
different buttons...

<form method="post" name="form1" action="processStuff.php">
<input type="submit" name="action" value="Add Record">
<input type="submit" name="action" value="Delete Record">

In processStuff.php

<?php
switch ($_POST['action']){
	case "Add Record":
	 ...do stuff...
	 ..redirect back to original page...
	break;

	case "Delete Record":
	 ...do stuff...
	 ..redirect back to original page...
	break;

}
?>

-- 
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