Working Godaddy gdform.php

690 views
Skip to first unread message

Steve Smith

unread,
Sep 29, 2010, 5:12:50 AM9/29/10
to reCAPTCHA
I see that a lot of people have a hard time getting the godaddy
gdform.php, I called them, they told me that I can do anything I want
with the file, so here is the source code of the file on my server
gdform.php:

Source code belong

<?php
require_once('recaptchalib.php');
$privatekey = "6LdMbL0SAAAAAF1pNENnTKn7J9y6OwQEfX8Ros5E";
$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 {

$request_method = $_SERVER["REQUEST_METHOD"];
if($request_method == "GET"){
$query_vars = $_GET;
} elseif ($request_method == "POST"){
$query_vars = $_POST;
}
reset($query_vars);
$t = date("U");

$file = $_SERVER['DOCUMENT_ROOT'] . "/../data/gdform_" . $t;
$fp = fopen($file,"w");
while (list ($key, $val) = each ($query_vars)) {
fputs($fp,"<GDFORM_VARIABLE NAME=$key START>\n");
fputs($fp,"$val\n");
fputs($fp,"<GDFORM_VARIABLE NAME=$key END>\n");
if ($key == "redirect") { $landing_page = $val;}
}
fclose($fp);
if ($landing_page != ""){
header("Location: http://".$_SERVER["HTTP_HOST"]."/$landing_page");
} else {
header("Location: http://".$_SERVER["HTTP_HOST"]."/");
}

}
?>

If you want to ask me questions, email me at zedax...@gmail.com,
and I will help you, if possible.

Steve Smith

unread,
Sep 29, 2010, 5:18:28 AM9/29/10
to reCAPTCHA
Source code one of the three forms that uses the above gdform.php file
is below, I reference a universal thank you file that you can easily
create, it makes the file virtually invisable when the answer is
correct, I will modify the gdform.php futher to make a graphic
response instead of text.

<h1>Contact Zed Axis Productions</h1>
<p class="font"><script type="text/javascript"> var RecaptchaOptions
= { theme : 'white' }; </script>
<form action="http://zedaxis.net/gdform.php" method="post">
<input type="hidden" name="redirect" value="thankyou.php">
<input type="hidden" name="recipient" value="steve...@zedaxis.net">
<table width="200" class="forms">
<tr><td><font class="font">Name: </td><td><input type="text"
name="name" size="20" maxlength="80" value=""></td></tr>
<tr><td><font class="font">Subject: </td><td><input type="text"
name="subject" size="20" maxlength="80" value=""></td></tr>
<tr><td><font class="font">Telephone: </td><td><input type="text"
name="Phone-Number" size="20" maxlength="80" value=""></td></tr>
<tr><td><font class="font">Cellphone: </td><td><input type="text"
name="Cellphone" size="20" maxlength="80" value=""></td></tr>
<tr><td><font class="font">E-mail: </td><td><input type="text"
name="email" size="20" maxlength="80" value=""></td></tr>
</table><p>
Compose Message:<br>
<textarea name="message" rows="8" cols="40" style="font-size: 10pt;
color: #000000; border: #6c6c6c 1px solid; background: #ffffff"></
textarea>
<p>
<?php
require_once('recaptchalib.php');
$publickey = "uniqueprivatekeygoeshere"; // you got this from the
signup page
echo recaptcha_get_html($publickey);
?>
</p>
<p>
<input type="submit" value="Send">&nbsp;<input type="reset"
value="Reset">
</form>
</p>

Visit site at http://www.zedaxis.net/
Reply all
Reply to author
Forward
0 new messages