a little bit of a spoonfeed but w/evr
Idk if this is right i just did it in the last 3 min, and havn't tested it
If anyone cares to post any bugs for me, please do
Anyways here's one with captcha(NOT TESTED)
Code:
<?php
if(!isset($_POST['submit'])) {
require_once('recaptchalib.php');
$publickey = "";//your recaptcha public key
$privatekey = "";//your recaptcha private key
echo "<center>";
echo "<form method='post'>";
echo "Your E-mail: <input type='text' name='email' maxlength='40'><br>";
echo "Message Title: <input type='text' name='title' maxlength='40'><br>";
echo "Message: <textarea cols='30' rows='8' name='message' maxlength='200' wrap=virtual></textarea><br>";
echo "<input type='submit' value='Contact' name='submit'><br>";
echo "<font color='red'>Script by Apixen of Ragezone/************</color>";
}
else{
if(!$_POST['email'] || !$_POST['title'] || !$_POST['message'] || $_POST['recaptcha_response_field']) {
die("You must fill in all the fields.");
} else {
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);
if (!$resp->is_valid) {
die("Recaptcha entered wrong");
}
else{
$email = $_POST['email'];
$title = $_POST['title'];
$message = $_POST['message'];
$v_ip = $_SERVER['REMOTE_ADDR'];
$v_date = date("l d F H:i:s");
$fp = fopen("Log/Contactlog.txt", "a");
fputs($fp, "Someone has contacted the staff. Please report to this message A.S.A.P! \n\n IP: $v_ip \n\n DATE: $v_date \n\n Email - $email \n\n Message Title - $title \n\n Message: $message\n\n\n\n");
fclose($fp);
echo "<br><font color='green'>That's sad, you leeched my script from me ;[ -Apixen</color>";
}
}
}
?>
You basically acquire the api from recaptcha and your priv/pub key.