running a function after a form submit
| From: | Richard Kurth | Date: | Fri, 27 Jul 2001 02:45:15 +0000 |
| Subject: | running a function after a form submit | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-59861@lists.php.net to get a copy of this message | ||
Is there a way to run a function when a form is submitted this is an
example below this form is being feed buy the form above and when the
customer verifies the data that has input he submits it again I what
to fire a function when he submits the second time
<?
if (! (isset($action))) {
?>
<form action="<?=basename($PHP_SELF)?>" method="post">
<table width="300" border="0" align="center">
<tr>
<td><VAR>First Name</VAR></td>
<td><input type="text" name="fname"
value=""></td>
</tr>
<tr>
<td><VAR>Last Name</VAR></td>
<td><INPUT TYPE="text" NAME="lname"
VALUE=""></td>
</tr>
<tr>
<td><VAR>Address</VAR></td>
<td><INPUT TYPE="text" NAME="address"
VALUE=""></td>
</tr>
<tr>
<td colspan="2" align="center"><SCRIPT>
document.write ("<input type=hidden name='AFFILIATE_ID' value=\"" +
GetCookie("AFFILIATE") + "\">");
</SCRIPT><input type="hidden" name="action" value="check">
<input type="submit" name="submit" value="Submit">
<input type="Reset"></td>
</tr>
</table>
</form>
<?php
}
if ($action == 'check') {
?>
show the info for customer to varafy
<VAR>First Name</VAR> <A><?echo
$fname?></A><br>
<VAR>Last Name</VAR> <A><?echo
$lname?></A><br>
<VAR>Address </VAR> <A><?echo $address?></A>
<br>
<FORM ACTION="https://www.paypal.com/cgi-bin/webscr"
METHOD="POST">
INPUT TYPE="hidden" NAME="last_name" VALUE="<?echo $lname?>">
<INPUT TYPE="hidden" NAME="address1" VALUE="<?echo
$address?>">
<INPUT TYPE="hidden" NAME="address2" VALUE="<?echo
$address2?>">
<INPUT TYPE="hidden" NAME="city" VALUE="<?echo $city?>">
<input type="submit" name="Submit" value="Submit">
</form>
<?savetoafil(); }?> <----I what this function to run after the
submit button is clicked.
Best regards,
Richard
mailto:rkurth@pacifier.com