- This topic is empty.
Viewing 1 post (of 1 total)
-
AuthorPosts
-
January 10, 2012 at 1:58 am #36046mihir007007Participant
i am newbie and downloaded a css template . it had built in contact form which i am unable to set it working , i am not receiving any e-mail . i have uploaded files on a free webserver xtreemehost.com . plz help .
here is the send mail.php … i have edited only the first line i.e email address
// Who you want to recieve the emails from the form. (Hint: generally you.)
$sendto = '[email protected]';
// The subject you'll see in your inbox
$subject = 'Contact from contact form';
// Message for the user when he/she doesn't fill in the form correctly.
$errormessage = 'Oops! There seems to have been a problem. May we suggest...';
// Message for the user when he/she fills in the form correctly.
$thanks = "Thanks for the email! We'll get back to you as soon as possible!";
// Message for the bot when it fills in in at all.
$honeypot = "You filled in the honeypot! If you're human, try again!";
// Various messages displayed when the fields are empty.
$emptyname = 'Entering your name?';
$emptyemail = 'Entering your email address?';
$emptysubject = 'Entering a subject?';
$emptymessage = 'Entering a message?';
// Various messages displayed when the fields are incorrectly formatted.
$alertname = 'Entering your name using only the standard alphabet?';
$alertemail = 'Entering your email in this format: [email protected]?';
$alertsubject = 'You must enter a subject';
$alertmessage = "Making sure you aren't using any parenthesis or other escaping characters in the message? Most URLS are fine though!";
//
Thats it! don't mess with below unless you are really smart!
//Setting used variables.
$alert = '';
$pass = 0;
// Sanitizing the data, kind of done via error messages first. Twice is better! ;-)
function clean_var($variable) {
$variable = strip_tags(stripslashes(trim(rtrim($variable))));
return $variable;
}
//The first if for honeypot.
if ( empty($_REQUEST) ) {
// A bunch of if's for all the fields and the error messages.
if ( empty($_REQUEST) ) {
$pass = 1;
$alert .= "- " . $emptyname . "
";
} elseif ( ereg( "[][{}()*+?.\^$|]", $_REQUEST ) ) {
$pass = 1;
$alert .= "- " . $alertname . "
";
}
if ( empty($_REQUEST) ) {
$pass = 1;
$alert .= "- " . $emptyemail . "
";
} elseif ( !eregi("^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3})$", $_REQUEST) ) {
$pass = 1;
$alert .= "- " . $alertemail . "
";
}
if ( empty($_REQUEST) ) {
$pass = 1;
$alert .= "- " . $emptysubject . "
";
} elseif ( !(strlen($_REQUEST)>4) ) {
$pass = 1;
$alert .= "- " . $alertsubject . "
";
}
if ( empty($_REQUEST) ) {
$pass = 1;
$alert .= "- " . $emptymessage . "
";
} elseif ( ereg( "[][{}()*+?\^$|]", $_REQUEST ) ) {
$pass = 1;
$alert .= "- " . $alertmessage . "
";
}
elseif(isset($_REQUEST))
{
//checks 3al email
$myemail=$_REQUEST;
$teet=explode(".",$myemail);
if(count($teet)==1)
{
$pass=1;
$alert.="- Email Not a valid
";
}
}
//If the user err'd, print the error messages.
if ( $pass==1 ) {
//This first line is for ajax/javascript, comment it or delete it if this isn't your cup o' tea.
echo "";
echo $errormessage;
echo "- ";
echo $alert;
echo "
// If the user didn't err and there is in fact a message, time to email it.
} elseif (isset($_REQUEST)) {
//Construct the message.
$message = "From: " . clean_var($_REQUEST) . "n";
$message .= "Email: " . clean_var($_REQUEST) . "n";
$message .= "subject: " . clean_var($_REQUEST) . "n";
$message .= "Message: n" . clean_var($_REQUEST);
$message .= "URL: n" . clean_var($_REQUEST);
$header = 'From:'. clean_var($_REQUEST);
//Mail the message - for production
//mail($sendto, $subject, $message, $header);
//This is for javascript,
echo "";
echo $thanks;
die();
//Echo the email message - for development
echo "
" . $message;
}
//If honeypot is filled, trigger the message that bot likely won't see.
} else {
echo "";
echo $honeypot;
}
?>
/////////////////////////////////////////////////////////////////////////////////
here is the contact.html part of the form .. see it here http://bondmihir.co.cc/agd/contact.html
-
AuthorPosts
Viewing 1 post (of 1 total)
- The forum ‘Back End’ is closed to new topics and replies.