Forum Moderators: coopster
<form id="contact" method="post" enctype="multipart/form-data" action="http://www.mydomain.com/cgi-bin/formmail.pl">
<form id="contact" method="post" enctype="multipart/form-data" action="http://www.mydomain.com/recaptcha/verify.php">
<?php
require_once('http://www.mydomain.com/recaptcha/recaptchalib.php');
$privatekey = "blahblah";
$resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);
if (!$resp->is_valid) { // What happens when the CAPTCHA was entered incorrectly
die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." .
"(reCAPTCHA said: " . $resp->error . ")");
} else {
// Your code here to handle a successful verification
HERE IS MY QUESTION! <-------------------------------------
}
?>
?>
<form id="contact" ... action="formmail.pl">
<input type="hidden" id="foo1" value="<?php echo $someData ?>">
...
</form>
<script type="text/javascript">
var frm = document.getElementById("contact");
window.onload = frm.submit();
</script>
<?php
http://www.mydomain.com/cgi-bin/formmail.pl and pass the post information to it? <input type=text name="email" size="40"> <input type="hidden" id="email" value="<?php $_POST['email'] ?>">
<input type="hidden" name="require" value="realname,email,comments">
<input type="hidden" name="env_report" value="REMOTE_HOST,HTTP_USER_AGENT,REMOTE_ADDR,REMOTE_USER">
<input type=hidden name="redirect" value="contact_thankyou.html">
<input type=hidden name="missing_fields_redirect" value="contact_error.html">
<input name="subject" size="40">
<input type=text name="realname" size="40">
<input type=text name="email" size="40">
<textarea name="comments" cols="60" rows="10" wrap="soft">
<!doctype html public "-//w3c//dtd html 3.2//en">
<html>
<head>
<title>Cancellation</title>
</head>
<body background="../bg.gif" text="#000000" bgcolor="#E5E5E5" link="#0000ff" vlink="#800080" alink="#ff0000">
<div align="center"><img src="../ezform/logo.jpg" width="610" height="109" border="0"></div>
<p>
<div align="center"><font face="Arial" size="3" color="#0066CC"><b><b>WE ARE SORRY THAT YOU ARE UNABLE TO ATTEND THE RALLY THIS YEAR</b>
<p>
<div align="center"><font face="Arial" size="3" color="#0066CC"><b>PLEASE USE THIS FORM TO CANCEL YOUR REGISTRATION</b>
</div>
<p>
<font face="Arial" size="2" color="#ff0000">Please note that this form is for cancelling your registration with the event only<br> and does not cancel your reservation with the State Parks (Reserve America)</font>
</div>
<p>
<script type="text/javascript">
var RecaptchaOptions = {
theme : 'white'
};
</script>
<div align="center">
<form method="post" action="../verify.php" name="regform3">
<input type="hidden" name="fname" value="Cancellation">
<table width=65% border="5" bordercolor="#0066CC" bgcolor="#C4DEFF">
</tr>
<tr align=right>
<td><font face="MS Sans Serif" size="2">(Attendee Name) First:</font></td>
<td align=left>
<input type=text name="FirstName" size=25><font face="MS Sans Serif" size="2"> Last:</font> <input type=text name="LastName" size=25> <font face="MS Sans Serif" size="2" color="blue">Required</font></td>
</tr>
<tr align=right>
<td><font face="MS Sans Serif" size="2">Your email address:</font></td>
<td align=left>
<input type=text name="Email Address" size=40> <font face="MS Sans Serif" size="2" color="blue">Required</font></td>
</tr>
<tr align=right>
<td><font face="MS Sans Serif" size="2">Your loop (A, B, or C):</font></td>
<td align=left>
<input type=text name="Loop" size=1 Maxlength="1"> </font><font face="MS Sans Serif" size="2" color="black">Your site #:</font>
<input type=text name="Site Number" size=1 Maxlength="2"> <font face="MS Sans Serif" size="2" color="blue">Required</td></td>
</tr>
<tr>
<td align=right valign=top><font face="MS Sans Serif" size="2">Comments: <br>
</td>
<td align=left>
<textarea name ="Comments" cols="55" rows="6" wrap="virtual"></textarea>
</td>
</tr>
<input type="hidden" name="gif">
</table>
<p>
<div align="center"><font face="MS Sans Serif" size="2" color="#ff0000"><b>Please be aware that this form is to cancel your registration only.<br>This form will not cancel your reservation with State Parks (Reserve America)<br> and you will have to do that on your own</b></font>
</div>
<script type="text/javascript"
src="http://www.google.com/recaptcha/api/challenge?k=my_key">
</script>
<noscript>
<iframe src="http://www.google.com/recaptcha/api/noscript?k=my_key"
height="300" width="500" frameborder="0"></iframe><br>
<textarea name="recaptcha_challenge_field" rows="3" cols="40">
</textarea>
<input type="hidden" name="recaptcha_response_field"
value="manual_challenge">
</noscript>
<p>
<div align="center"><font face="MS Sans Serif" size="2" color="red">Type in the two words above before clicking the "Submit" button! If you can not read the words then click the <img src="../refresh.png"> above</font></div>
<p>
<input type="image" SRC="cancel.gif" HEIGHT="38" WIDTH="224" BORDER="0" ALT="Submit Form"></form></div>
</body>
</html>
<?php
require_once('recaptchalib.php');
$privatekey = "my_key";
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);
if (!$resp->is_valid) {
die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." .
"(reCAPTCHA said: " . $resp->error . ")");
}
?>
<?php
require_once('recaptchalib.php');
$privatekey = "my_key";
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);
if (!$resp->is_valid) {
// What happens when the CAPTCHA was entered incorrectly
die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." .
"(reCAPTCHA said: " . $resp->error . ")");
} else {
// Your code here to handle a successful verification
?>
<form name="regform3" action="../cgi-bin/ezform.cgi">
<input type="hidden" name="fname" value="<?php $_POST['Cancellation']; ?>">
</form>
<script type="text/javascript">
var frm = document.getElementsByName("fname");
window.onload = frm.submit();
</script>
<?php
}
?>
<?php
require_once('recaptchalib.php');
$privatekey = "my_key";
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);
if (!$resp->is_valid) {
// What happens when the CAPTCHA was entered incorrectly
die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." .
"(reCAPTCHA said: " . $resp->error . ")");
} else {
// Your code here to handle a successful verification
//create array of data to be posted
$post_data['fname'] = 'Cancelation';
$post_data['FirstName'] = 'FirstName';
$post_data['LastName'] = 'LastName';
$post_data['Email Adres'] = 'Email Adress';
$post_data['Loop'] = 'Loop';
$post_data['Site Number'] = 'Site Number';
$post_data['Comments'] = 'Comments';
$post_data['gif'] = 'gif';
//traverse array and prepare data for posting (key1=value1)
foreach ( $post_data as $key => $value) {
$post_items[] = $key . '=' . $value;
}
//create the final string to be posted using implode()
$post_string = implode ('&', $post_items);
//create cURL connection
$curl_connection =
curl_init('http://www.my_domain.com/cgi-bin/ezform.cgi');
//set options
curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($curl_connection, CURLOPT_USERAGENT,
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl_connection, CURLOPT_FOLLOWLOCATION, 1);
//set data to be posted
curl_setopt($curl_connection, CURLOPT_POSTFIELDS, $post_string);
//perform our request
$result = curl_exec($curl_connection);
//show information regarding the request
print_r(curl_getinfo($curl_connection));
echo curl_errno($curl_connection) . '-' .
curl_error($curl_connection);
//close the connection
curl_close($curl_connection);
}
?>
Array ( [url] => http://www.my_domain.com/cgi-bin/ezform.cgi [content_type] => text/plain [http_code] => 200 [header_size] => 149 [request_size] => 351 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 0.275799 [namelookup_time] => 0.174788 [connect_time] => 0.174969 [pretransfer_time] => 0.174978 [size_upload] => 140 [size_download] => 51 [speed_download] => 184 [speed_upload] => 507 [download_content_length] => -1 [upload_content_length] => 0 [starttransfer_time] => 0.274824 [redirect_time] => 0 ) 0-