When submitting an order on my booking form found here: http://www.n-v-m.co.uk/Booking.html the php file 'sendfile.php' is triggered and this sends booking details to my email account.

This is the php code in 'sendfile.php'

<?php

$Name = $_POST['name']; //senders name

$to = "info@n-v-m.co.uk"; //recipient
$subject = "Order from ".$_POST['company']." (".$_POST['name'].")"; //subject
$message = $_POST['company']."|".$_POST['name']."|".$_POST['phonenum']."|".$_POST['email']."|".$_POST['vmam']."|".$_POST['vreg']."|".$_POST['colladd']."|".$_POST['collconname']."|".$_POST['collconnum']."|".$_POST['deladd']."|".$_POST['delconname']."|".$_POST['delconnum']."|".$_POST['collectiondt']."|".$_POST['deliverydt']."|".$_POST['Taxed']."|".$_POST['billadd']."|".$_POST['custordnum']."|".$_POST['addcom']; //mail body
$from = "NVM Booking Form"; //
$headers = "From: ".$from."\r\n"; //optional headerfields
 
mail($to, $subject, $message, $headers); //mail command
header( 'Location: http://www.n-v-m.co.uk/Thankyou.html' ) ;
?>

If the booking form is left blank when 'Submit Order' is clicked I would get this sent to my email: '||||||||||||||No|||'. This is because the field 'Is Vehicle Taxed:' must return a value of 'Yes' or 'No'. I have received plenty of orders like this in the past, usually down to people simply testing the form.

On a couple of occasions recently however I have received bookings like this '|||||||||||||||||' which should not be possible as the 'Is Vehicle Taxed:' field should always display either 'Yes' or 'No'! I have since found out a couple of these orders we're serious orders that have not got through to me!

To try and explain what I am trying to say as simply as possible - when I get a booking that displays '||||||||||||||No|||' I know it is just simply somebody messing around with the form but when I get a booking that displays '|||||||||||||||||' I know there has been a problem with the booking process and I could have missed a serious order.

The latter has only happened two times in 6 months so I am inclined to think it is something to do with settings on the PC of the customer making the order. I have tried testing on a few different PC's myself but the orders come through ok every time so I cant trace the problem!

Does anyone have an idea of what could be causing this?

First thing: You should make it a bit more readable, how can anybody understand and email like that ('||||||||||||||No|||').

You should return an error if the field is empty, this would stop the spam (if you would call it that) and may solve (or help to solve) your problem.

Another thing: You shouldn't use an image as you whole site, use text. Have you not thought about bots (like Google)?

Ok... firstly '||||||||||||||No|||' and '|||||||||||||||||' refer to the $message (line number 7 in the PHP syntax) that is posted back to me when an order in submitted - sorry I thought this may have been clear when looking at the PHP code - this may not make sense to anybody else but it does not really need to make sense to anyone else as it makes perfect sense to me.

Of course a normal booking would have many if not all the fields filled in so there would usually be data between the delimeters '|'. However, I need to be able to give the customer the option to leave any field blank which is why it is possible to submit a booking that posts back to me this string: '||||||||||||||No|||'.

It should not be possible to submit a booking that posts back to me this string though: '|||||||||||||||||' and all I am asking is if anybody can tell me why this could be happening?

I'll try make un-complicate this a little....

When submitting a booking on this page http://www.n-v-m.co.uk/Booking.html most of the time there is no problem but sometimes I get completely blank bookings sent through (even when I know the customer has filled the form out).

Does anybody know why this could be happening? It is a very rare problem which makes me think it may have something to do with internet settings on the customers computer

I don't see how that could be happening. Maybe people just going to the "sendform.php" page.

I know the last customer to have this problem was using Internet Explorer... Could the problem be somewhere in 'Tools>Internet Options'?

I've probably over complicated this so I am going to start a new thread and mark this one as solved

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.