2012-04-12, 04:36 PM
Hi!
I need a script for Invitation other users to my forum.
I find this:
But it hasn't any option for secure form from spammers (like captcha)
has anyone better code?
can anyone help me?
I need a script for Invitation other users to my forum.
I find this:
<?php
// Gather info into variables
$email = $_REQUEST['email'];
$message = $_REQUEST['message'];
$youremail = $_REQUEST['youremail'];
$message2 = "YourMessageHere!";
// If $email is not set, $message is empty so as $youremail, then show the form
if(!isset($email) && empty($message) && empty($youremail)){
echo "<form action='' method='post'>"
."<font>Invite your friends</font><br><br>"
."<font><b>Email: </b> <input type='text' name='email' size='30'><br>"
."<font><b>Your email: </b><input type='text' name='youremail' size='30'><br>"
."<font><b>Message: </b><br><textarea name='message' cols='30' rows='5'></textarea><br>"
."<input type='submit' value='Invite'>";
}
// If $youremail is empty then show the error
elseif(empty($youremail)){
die("Please enter your email!");
}
// If $message is empty then show the error
elseif(empty($message)){
die("Please enter your message!");
//If everything is okay let's send our invitation
}else{
$send = mail($email, "Invitation", $message."
$message2", "From: $youremail");
// If we can not send this email let's show the error
if(!$send){
echo "Can not send your invitation!";
}
// If this invitation was sent then let's show that "Invitation sent" message
else{
echo "Invitation sent!";
}
}
?>
But it hasn't any option for secure form from spammers (like captcha)
has anyone better code?
can anyone help me?