Newbie php problem
- From: "Floor" <f.dessing@xxxxxxxxxxxxxxxxxxx>
- Date: Wed, 7 Jan 2009 22:09:33 +0100
I have written a simple php script that handles sending form content to a
recipient.
My problem is, that allthough I check behavior on form fields, sometimes an
empty form shows up. I think this is due to the fact that someone runs the
php script by hand (spiders?). To avoid this, I am looking for a way of
breaking out running the php script as soon as one of the $_POST[xxxx]
contains spaces or nothing at all. So the mail($to....) line should be
skipped. Can someone hint me out on this?
Thanks in advance...
Example script, header fields etc deleted:
<?php
$to = "Me <me@xxxxxxxxxxxxx>";
$subject = "Request from $_POST[Name]";
$message = "There has been a request
$_POST[Name]
$_POST[Adress]
$_POST[Postcode] $_POST[Town]
";
mail($to, $subject, $message);
?>
-- Floor
.
- Follow-Ups:
- Re: Newbie php problem
- From: Tim Greer
- Re: Newbie php problem
- Prev by Date: Re: Updated PHP 5 - curl init error
- Next by Date: Re: Newbie php problem
- Previous by thread: Re: Updated PHP 5 - curl init error
- Next by thread: Re: Newbie php problem
- Index(es):