Forum Moderators: coopster
For example:
<FORM name="testform" method="post" action="http://foo.com">
<INPUT TYPE="hidden" name="userid" value="3005">
<INPUT TYPE="image" src="some_button.gif" name="submit" onClick="<?php
$body = "Userid = ".? what do I put here to get the value out of the userid form field?
mail("foo@bar.com", "Someone clicked a form!", $body, "From:bar@foo.com");
?>">
--Mike
If I understand it right what you're trying to do, I'd say that it is not possible before the form gets submitted. The form values are on the client side whereas PHP is running on the server-side. Any processing would need to be done by the script specified in the
ACTION attribute. But then it's no problem - just put the mail command in that script. Hope it helps,
M.
Unfortunately, I don't have control over the script in the action side, its being hosted by a third party.
Alternatively, could I call my own script or subroutine (even Javascript) and have it re-issue the post? I have no idea how to issue a post without a submit button though...
--Mike
You could plug in your script as the action and then you have two choices
1. Make a confirmation screen. Email all you need to yourself and then have another submit button at the bottom to resub the info to the other script. Have a titla similar to "You ebtered this info please click submit to send it".
2. take a look at curl
[ca.php.net...]