Using POST to pass variables
| From: | Todd Cary | Date: | Thu, 01 Dec 2005 04:50:34 +0000 |
| Subject: | Using POST to pass variables | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-226675@lists.php.net to get a copy of this message | ||
When I have more than one button on a page, I us what I call a reentrant approach. That is the page calls itself.
If the page is emailer.pgp, the the FORM tag would be
<form method="get" action="emailer.php">
At the top is
<?php
$send = $_GET[btnSend]; // Send button pressed$cancel = $_GET[btnCancel];// Cancel is pressed $message = $_GET[message]; if ($send) {
header("location: send.php?message=" . $message);
}
if ($cancel) {
header("location: index.php");
}
?>
Is there a better way to do this so I can use a POST form?
Thank you...
Todd