FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


do not work auto reply..





subirbasak
hi members..
In my site auto responce in contact donot workcan any body solve this problem?I given below the php code:

<?php
$contact_name = $_POST['name'];
$contact_email = $_POST['email'];
$contact_subject = $_POST['subject'];
$contact_message = $_POST['message'];

if( $contact_name == true )
{
$sender = $contact_email;
$receiver = $contact_email;
$client_ip = $_SERVER['REMOTE_ADDR'];

$email_body = "Name: $contact_name \nEmail: $sender \n\nSubject: $contact_subject \n\nMessage: \n\n$contact_message \n\nIP: $client_ip \n\nFlash Contact Form provided by http://subirbasak.orgfree.com";
$email_body_auto_reply = "Hello $contact_name, \nThis is the auto reply message. Thank you for your remarks \n\nAdmin - http://subirbasak.orgfree.com";

$extra = "From: $sender\r\n" . "Reply-To: $sender \r\n" . "X-Mailer: PHP/" . phpversion();
$extra_auto_reply = "From: $receiver\r\n" . "Reply-To: $receiver \r\n" . "X-Mailer: PHP/" . phpversion();

mail( $sender, "Auto Reply - Re: $contact_subject", $email_body_auto_reply, $extra_auto_reply ); // auto reply mail to sender

if( mail( $receiver, "Flash Contact Form - $contact_subject", $email_body, $extra ) )
{
echo "success=yes";
}
else
{
echo "success=no";
}
}
?>


Can any body solve my pboblem?I dont know anything about PHP..subir
http://subirbasak.orgfree.com
sonam
Did you get any error message, blank page or what? Is this your code or you are get somewhere. It is very bad spam protected Shocked and you need some more work on it.

Sonam
rvec
better not actually use this script. You'll get loads of spam from it and others might also get spam from this script. Usage of this script may get your account suspended.
BillysProgrammer
Basically what you just posted, was a unprotected file, which you will recieve a lot of spam of course. Try doing the following.

    Checking email format using preg_replace or ereg.
    Make sure everything is a valid alphanumeric string.
    Learn more Very Happy
rvec
BillysProgrammer wrote:

Checking email format using preg_replace or ereg.
Make sure everything is a valid alphanumeric string.
Learn more Very Happy

Why not use this:
http://nl2.php.net/manual/en/function.filter-var.php
You can't make a mistake in your regex that way.

Alphanumeric :S
What to do with the !#$%&'*+/=?^_`{|}~-@. Or did you mean the mail itself?

The thing you should watch out for is that someone can add headers to the mail like with $_POST['email'] in the above script.

The last thing is always good Smile
Related topics
PHP: Feedback form issues.. help =P
Check THIS script
I like School Computers
(official) Firefox & Thunderbird 1.5 Beta2 Now Available
Not Voting is Reasonable for People Who Want Freedom
Worst work related stories.
Flash Theft Auto
my personal website (update)
My website.
TYPO3 is anyone here?
The new way to advertise using YouTube?
Programmer needed for small application.
Can I be a mom, wife and graduate student?
What is your Frihost Hosting for?
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.