███ CGI Question, "IF" Instruction?

  • Thread starter Thread starter robert c
  • Start date Start date
R

robert c

Guest
With lots of help I did the following scrip:

------------------------------------------------------------------------------------------------------
<?php
date_default_timezone_set('America/Chicago');
$date = date("d/m/Y h:i");

$w_company = "Lawn Care and Landscape Design";
$w_malito = "[email protected]";
$w_owner = "MyName";

$w_thankyoupage='thankyou.php';
/*
$w_headerfrom="From: $name <$email>\n";
*/
$w_headerfrom="From: <$email>";
$w_subjectfrom="$interest";


$w_txtfrom="
On: $date

Name: $name\n
Address: $address\n
CityZip: $cityzip\n
Email: $email\n
Phone: $phone\n
CallMe: $callme\n
StartOn: $schedule4\n
Interest: $interest\n
How Often: $schedule\n
Engine: $engine\n
Message: $details\n
";

$headers = "$w_headerfrom";
$w_subject = "$interest";
$w_myemail = "$w_malito";
$w_msntxt = "$w_txtfrom";
mail($w_myemail,$w_subject,$w_msntxt,$headers);

$w_subjectto = "$interest";
$w_headerto = "From: $w_company <$w_malito>\n";
$w_txtto ="Thank you for your inquire. I am going to get in touch with you in a few minutes.\n\nRegards,\n\nRobert Barros\nCreative Lawn Care n Landscape Design\n\nSent on: $date";

$headers = "$w_headerto";
$w_subject = "Re: <$interest>";
$w_msntxt = "$w_txtto";
mail($email,$w_subject,$w_msntxt,$headers);

echo "<script>window.location='$w_thankyoupage'</script>";

?>
--------------------------------------------------------------------

My Question is.. How can I avoid get empty messages... I guess if I use the "IF" instruction will work but I don't know how to use.... I was wonder check the $name\n if empty return a message such as: Please, don't try play around idiot!

Thanks for any help.

Robert
 
Back
Top