my form is being auto filled i think

BWD

New Member
Hi all
I wrote a script for my online form using php
simple yes but this is what im so pissed off at
every day i get a couple of emails from NOBODY and the email is blank
my form works a treat and it does return my potencial clients info
but it sometimes comes back as submited without info
i tryed to get around this by making the fields in my form compulsary , hence you must fill or you dont get to the process page
but this didnt work
well it does but strange as it may seem i still get blank forms submited and there from mr NOBODY again ( nobody is the Email from )

any ways i tryed to get around it again by making the script check its self for fields submited like this

if($firstname=="" || $lastname=="" || $email=="")
{
$errors=1;
$error.="You did not enter one or more of the required fields. Please go back and try again.";}
if($errors==1) echo $error;
else

print bla bla bla

this does stop the average joe from submiting a blank form to me but for some strange reason i still get blank submited forms

any help any one

the form does work
ive tested it on many a pc and on many a diferent browser IE firefox and so on

could it be a spider crawling the form handeler and making it think it is being used then submitting it to me ?

im stumped
ive made a shed load of forms before using my own hand writen php but this is a new problem to me ??

:eek:
 
Last edited:

BWD

New Member
source code

<?
$message = $_POST['message'];
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$streetname = $_POST['streetname'];
$city = $_POST['city'];
$postcode = $_POST['postcode'];
$country = $_POST['country'];
$telephone = $_POST['telephone'];
$email = $_POST['email'];
$contactpref = $_POST['contactpref'];
$found = $_POST['found'];
$needservices = $_POST['needservices'];
$servicesneeded = $_POST['servicesneeded'];
$pricerange = $_POST['pricerange'];
$asdr = $_POST['asdr'];

$asdr2 = $_POST['asdr2'];
$asdr3 = $_POST['asdr3'];
$comment = $_POST['comment'];

if($firstname=="" || $lastname=="" || $email=="")
{
$errors=1;
$error.="You did not enter one or more of the required fields. Please go back and try again.";}
if($errors==1) echo $error;
else

print "<p>Thank you $firstname.<br />
You told me your full name is $firstname $lastname and your address is <br />
<br />
$streetname<br />
$city<br />
$postcode<br />
$country<br />
<br />
You told me you prefered to be contacted via $contactpref <br />
Your Email address is $email and your telephone number is $telephone .<br />
<br />
You found my site via $found.<br />
<br />
What you need from me is $servicesneeded and you price range is £ $pricerange .<br />
You would like your project finished for $asdr /$asdr2 /$asdr3<br />
<br />
You left these comments :<br />
<br />
$comment
</p>
";
$message="Thank you $firstname.
You told me your full name is $firstname $lastname and your address is

$streetname
$city
$postcode
$country

You told me you prefered to be contacted via $contactpref
Your Email address is $email and your telephone number is $telephone .
this is the script that handles the form


You found my site via $found.

What you need from me is $servicesneeded and you price range is £ $pricerange .
You would like your project finished for $asdr /$asdr2 /$asdr3

You left these comments :

$comment

";
mail('[email protected]', "Form Submitted at your web site BWD", $message, "From: $email");
?>
 
Last edited:

Arkantos

New Member
what is happening, is that whenever the page is being hit, a mail is being sent. i dont know why, but it happened to me too.

the best and the easiest thing to do is separate the form and the mail script into two files and the confirmation in another.

so in effect you have 3 files instead of one.

Ark!
 
Top