loll_l 0 Light Poster

Thanks for the replies.

I should have explained that I need for the customer to be able to leave any field on the form blank.

If somebody does submit a blank booking form I would get this string sent through to me '||||||||||||||No|||' - note that the 4th to last field (Taxed) must be set to 'Yes' or 'No' so I should never receive a completely blank order.

Recently however I have received a couple or orders like this '|||||||||||||||||'. As the Taxed field must be either 'Yes' or 'No' these orders should not be possible which proves to me there is some kind of problem occurring during the booking process.

As this has only happened once or twice I am inclined to think the problem is specific to certain computers which is why I am wondering if the solution could be in internet settings?

loll_l 0 Light Poster

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

loll_l 0 Light Poster

When customers submit bookings on my website http://www.n-v-m.co.uk/Booking.html most of the time the booking goes through fine 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

The php code I am using is displayed below:

<?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' ) ;
?>

Any help would be much appreciated

loll_l 0 Light Poster

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

loll_l 0 Light Poster

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

loll_l 0 Light Poster

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?

loll_l 0 Light Poster

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 …

loll_l 0 Light Poster

cheers mate

loll_l 0 Light Poster

Please see my Booking Form here http://www.n-v-m.co.uk/Booking.html

The form is very nearly finished but I have no experience with JavaScript at all so I am hoping somebody can tell me how to do the finishing touches.

All I require is:

1- On clicking the 'Submit order' button I would like the browser to check to see if the 'Is Vehicle roadworthy with full M.O.T.:' List/Menu is set to 'Yes' and if not it needs to return an alert stating it must be set to 'Yes' to proceed... Somebody kindly helped show me how to do the alert before so this is working, but, the problem at the moment is after clicking 'OK' to close the alert, the form is still submitted. At this point instead of the form being submitted I would just like the browser to return to the form.

2- There is a checkbox on the bottom of the form that states 'I agree with the Terms and Conditions'... To be able to proceed with a booking I need the customer to check the box... On clicking 'Submit order' if the box isn't checked I would like an alert to appear and the form not to be submitted.

3. When both the above criteria have been met and the form is ready to submit... I would like the browser to re-direct to http://www.n-v-m.co.uk/Thankyou.html which is a page I have already created on my server.

Thanks for taking your …

loll_l 0 Light Poster

hi, i've tested the above and while there is no syntax error... it doesn't trigger the alert unfortunately!

loll_l 0 Light Poster

This is my booking form: http://www.n-v-m.co.uk/Booking.html

When 'Submit Order' is clicked a PHP script is triggered that emails me details of the order...

What I require is an alert to pop up if either:
a) The customer has selected 'No' for 'Is Vehicle roadworthy with full M.O.T.'
or
b) The customer has not checked the 'I agree with the Terms and Conditions' box.

The alert should pop up in front of the booking form and say either "The vehicle must be roadworthy with full M.O.T." or "You must agree to the Terms and Conditions".

Can somebody please tell me how to do this using Javascript?

I have included the code for my booking form and php script below just in case it helps.

Cheers

Paul

Booking Form:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>National Vehicle Movements - Booking Form</title>
<style type="text/css">
<!--
body {
	background-color: #1d255f;
	margin: 0px;
	padding: 0px;
}
#apDiv1 {
	position:absolute;
	width:487px;
	height:706px;
	z-index:auto;
	left: 50%;
	top: 433px;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 10px;
	font-weight: bold;
	text-align: center;
	textarea-align: center;
	background-position: center;
	margin-left: -244px;
}
-->
</style></head>
 
<body>
<div align="left">
  <div id="apDiv1">
    <form id="form1" name="form1" method="post" action="sendform.php">
<table width="400" border="0" align="center">
  
  <tr>
    <td width="193" align="center">Company:</td>
    <td width="197" align="center"><input type="text" name="company" id="Company" /></td>
  </tr>
  <tr>
    <td align="center">Name:</td>
    <td align="center"><input type="text" name="name" id="Name" /></td>
  </tr>
  <tr>
    <td align="center">Phone Number:</td>
    <td align="center"><input …
loll_l 0 Light Poster

Hi mate... this looks to be exactly the kind of thing I am looking for but unfortunately I have pasted the code into my Booking Form page and Dreamweaver is giving me the below error:

'There is a syntax error on line 28. Code hinting may not work until you fix this error.'

loll_l 0 Light Poster

The problem is I am still getting the order sent through to my email even when the compulsory fields are not correctly filled in (ie. I am still getting incomplete orders)

Ideally the browser will not go to the next page (Thankyou.php) until these 2 fields have been filled in correctly. All I require is a little error message that pops up if the 2 fields are set to the wrong value when the 'submit' button is clicked... am i right in saying this must be done using javascript?

I called this a pop up before but what I really mean is an 'error box' I think... I have seen them on numerous forms before

loll_l 0 Light Poster

Brilliant thanks.... i will make the changes and let you know if its worked.

Paul

loll_l 0 Light Poster

This is my booking form: http://www.n-v-m.co.uk/Booking.html

When 'Submit Order' is clicked a PHP script is triggered that emails me details of the order...

What I require is an error message to pop up if either:
a) The customer has selected 'No' for 'Is Vehicle roadworthy with full M.O.T.'
or
b) The customer has not checked the 'I agree with the Terms and Conditions' box.

The error message should pop up in front of the booking form and say either "The vehicle must be roadworthy with full M.O.T." or "You must agree to the Terms and Conditions".

There would then be an 'OK' button on the error message which when clicked would take you back to the booking form.

Can somebody please tell me how to do this?

Also, when a successful booking has been made (ie. the above 2 conditions have been met) I would like the PHP script to be triggered and the browser to redirect to http://www.n-v-m.co.uk/Thankyou.html

Can somebody please also explain how this is done?

I have included the code for my booking form and php script below just in case it helps.

Cheers

Paul

Booking Form:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>National Vehicle Movements - Booking Form</title>
<style type="text/css">
<!--
body {
	background-color: #1d255f;
	margin: 0px;
	padding: 0px;
}
#apDiv1 {
	position:absolute; …
loll_l 0 Light Poster

Thanks very much for your help harshbavaliya. The form looks much neater now you have put it in table format for me.

Unfortunately though I am looking for something slightly different with regards to submitting the form...

If either of the two compulsory fields have not been filled out correctly, what I really want is a pop up error message that says either 'The car must be roadworthy with Full M.O.T.' or 'You must agree to the Terms and Conditions'... Ideally I would like this pop up window to appear in front of the booking form and on pressing 'OK' to close it, the user/customer will be taken back to the booking form.

When the form has been filled in correctly, on clicking the 'submit' button I would like the PHP script to send the booking details to my email and I would then like the browser to redirect to www.n-v-m.co.uk/Thankyou.html

Is this possible?

Paul

loll_l 0 Light Poster

There are a few things I need to know how to do to complete the Booking Form on my website found here: http://www.n-v-m.co.uk/Booking.html

Any help on the below points would be much appreciated:

1- I need to center the labels in line with the multi line text fields... ie. where it says 'Collection Address including Postcode:' I want the label to be a couple of lines higher so that it is lined up with the center of the text area and not lined up with the bottom as it is now. I would have thought this would be an easy fix in Dreamweaver but I cant seem to find a solution!

2- When the form is live I want the text that is entered into the multi line text fields to be the same font/size as the text entered into the single line text fields... Currently they are different fonts/sizes but I don't know how to ammend it.

3- If the 'Is Vehicle roadworthy with full M.O.T.:' field is set 'No' or if the 'I agree with the Terms and Conditions' checkbox has not been checked I want the user to receive an error message telling them these must be set to 'Yes' and 'checked'. All other fields on the form are optional.

4- On completion of the form, instead of the message "Okey! We Are Proceed. Thank You !" I want the browser to redirect to http://www.n-v-m.co.uk/Thankyou.html

I have …

loll_l 0 Light Poster

Yes it turns out it was because I need to upgrade my hosting package! lol

Thanks

Paul

loll_l 0 Light Poster

Please ignore my last 2 posts... I found out I had to upgrade my web hosting.

Cheers.

Paul

loll_l 0 Light Poster

Has made no difference unfortunately... still just returns a blank screen!

I assume the below should be ok?:

<HTML><BODY>
<?php echo date("M-d-Y");
echo "<P>";
echo "Your IP Address is " . $_SERVER['REMOTE_ADDR'];
?>
</BODY></HTML>

Paul

loll_l 0 Light Poster

I am trying to go through this tutorial http://www.daniweb.com/tutorials/tutorial173026.html but when I load a php document in my browser I either get a blank page in the browser or dreamweaver opens the php and gives me a blank page!

My web host is www.123-reg.co.uk ... Will the problem be with my web host or could it be something else?

Paul

loll_l 0 Light Poster

I have also tried the code you sent me below as a test but on clicking "Send to us !" the browser just opens the php file in dreamweaver when I assume I should be getting the message "Okey! We Are Proceed. Thank You !"??

Does this mean there is a problem with my hosting?

Anyways ! If I have this code as a form

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
 <HEAD>
  <TITLE> New Document </TITLE>
  <META NAME="Generator" CONTENT="EditPlus">
  <META NAME="Author" CONTENT="">
  <META NAME="Keywords" CONTENT="">
  <META NAME="Description" CONTENT="">
 </HEAD>

 <BODY>
 <div align="center">
<form method="POST" action="test2.php">
What is Your Name : <input type="text" name="nm">
<br>
What is your Email Address : <input type="text" name="email">
<br>
Please enter your content here ! : <input type="text" name="content">
<br>
<input type="submit" name="sumbit" value="Send to us !">
</form>
</div>

 </BODY>
</HTML>

Then i will make a new php file which contain the below code, named test2.php

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
 <HEAD>
  <TITLE> New Document </TITLE>
  <META NAME="Generator" CONTENT="EditPlus">
  <META NAME="Author" CONTENT="">
  <META NAME="Keywords" CONTENT="">
  <META NAME="Description" CONTENT="">
 </HEAD>

 <BODY>
  <?php
$Name = $_POST['name']; //senders name
$email = $_POST['email']; //senders e-mail adress
$recipient = "harshbavaliya@gmail.com"; //recipient
$mail_body = $_POST['content']; //mail body
$subject = "Mail From Website Visitor"; //subject
$header = "From: ". $Name . " <" . $email . ">\r\n"; //optional headerfields
 
mail($recipient, $subject, $mail_body, $header); //mail command :)
if(mail)
	echo "Okey! We Are Proceed. Thank You !";
else
	echo "Sorry We Can't Proceed, Please Try After Some Time!";
?>
</BODY> …
loll_l 0 Light Poster

Sorry, unfortunately this problem isn't solved for me yet...

I have used the code you gave me and now on clicking submit the browser just sends me to a blank screen and I receive no email. Please feel free to look for yourself at www.n-v-m.co.uk/Booking.html

Here is the code I am using for the Booking Form now:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>National Vehicle Movements - Booking Form</title>
<style type="text/css">
<!--
body {
	background-color: #1d255f;
	margin: 0px;
	padding: 0px;
}
#apDiv1 {
	position:absolute;
	width:487px;
	height:706px;
	z-index:auto;
	left: 50%;
	top: 433px;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 10px;
	font-weight: bold;
	text-align: center;
	background-position: center;
	margin-left: -244px;
}
-->
</style></head>

<body>
<div align="center">
  <div id="apDiv1">
    <form id="form1" name="form1" method="post" action="sendform.php">
      <p><strong>Company:
        <input type="text" name="company" id="Company" />
      </strong></p>
      <p class="text"><strong>Name:
        <input type="text" name="name" id="Name" />
      </strong></p>
      <p class="text"><strong>Phone Number:
        <input type="text" name="phonenum" id="Phone Number" />
      </strong></p>
      <p class="text"><strong>Email Address:
        <input type="text" name="email" id="Email" />
      </strong></p>
      <p class="text"><strong>Vehicle Make and Model:
        <input type="text" name="vmam" id="Vehicle Make and Model" />
      </strong></p>
      <p class="text"><strong>Vehicle Reg./Ref. No.:
        <input type="text" name="vreg" id="Vehicle Reg." />
      </strong></p>
      <p class="text"><strong>Collection Address including Postcode:
          <textarea name="colladd" rows="4" id="Collection Address"></textarea>
      </strong></p>
      <p class="text"><strong>Collection Contact Name:
        <input type="text" name="collconname" id="Collection Contact Name" />
      </strong></p>
      <p class="text"><strong>Collection Contact Number:
        <input type="text" name="collconnum" id="Collection Contact Number" />
      </strong></p>
      <p class="text"><strong>Delivery Address including Postcode:
          <textarea name="deladd" rows="4" id="Delivery Address"></textarea>
      </strong></p>
      <p class="text"><strong>Delivery Contact Name:
        <input type="text" name="delconname" id="Delivery Contact …
loll_l 0 Light Poster

Thanks for the reply.

I think the best way to do this is, as you suggested, to post the whole code for my booking page which can be found here www.n-v-m.co.uk/Booking.html

As stated in my initial post the code may look a bit messy - please ignore this if you can:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>National Vehicle Movements - Booking Form</title>
<style type="text/css">
<!--
body {
background-color: #1d255f;
margin: 0px;
padding: 0px;
}
#apDiv1 {
position:absolute;
width:487px;
height:706px;
z-index:auto;
left: 50%;
top: 433px;
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
font-weight: bold;
text-align: center;
background-position: center;
margin-left: -244px;
}
-->
</style></head>

<body>
<div align="center">
<div id="apDiv1">
<form id="form1" name="form1" method="post" action="sendform.php">


<strong>Company:
<input type="text" name="Company" id="Company" />
</strong></p>
<p class="text"><strong>Name:
<input type="text" name="Name" id="Name" />
</strong></p>
<p class="text"><strong>Phone Number:
<input type="text" name="Phone Number" id="Phone Number" />
</strong></p>
<p class="text"><strong>Email Address:
<input type="text" name="Email" id="Email" />
</strong></p>
<p class="text"><strong>Vehicle Make and Model:
<input type="text" name="Vehicle Make and Model" id="Vehicle Make and Model" />
</strong></p>
<p class="text"><strong>Vehicle Reg./Ref. No.:
<input type="text" name="Vehicle Reg." id="Vehicle Reg." />
</strong></p>
<p class="text"><strong>Collection Address including Postcode:
<input type="text" name="Collection Address" id="Collection Address" />
</strong></p>
<p class="text"><strong>Collection Contact Name:
<input type="text" name="Collection Contact Name" id="Collection Contact Name" />
</strong></p>
<p class="text"><strong>Collection Contact Number:
<input type="text" name="Collection Contact Number" id="Collection Contact Number" />
</strong></p>
<p class="text"><strong>Delivery Address including Postcode:
<input type="text" name="Delivery Address" id="Delivery Address" />
</strong></p>
<p class="text"><strong>Delivery …
loll_l 0 Light Poster

Thanks for the reply but as I am completely new to all this can you please explain where to insert the code

loll_l 0 Light Poster

Hi,

I have recently designed a website for my new business. I have included a booking form which can be found here www.n-v-m.co.uk/Booking.html

I used Dreamweaver CS4 to create the site and 123-reg.co.uk is my web host

As it’s my first attempt at making a website I realise I may have constructed the site incorrectly. Please (for now) do not give me advice on how to make the site faster/tidier. All I wish to know is how to get the Booking Form working so that it sends information from the form to my email address.

Currently, on clicking the ‘Submit’ button the browser opens the customers email programme but I really require for the information to sent automatically back to my email address and then have the browser re-direct to www.n-v-m.co.uk/Thankyou.html

I have looked around a few forums and it seems I may need a PHP script but have no idea how to do this. Can anybody please explain what I must do? I would prefer not to have to spend any money if possible!

Thanks

Paul.

Ps. I also require the form to prevent the customer to ‘Submit’ unless ‘Is Vehicle roadworthy with full M.O.T.:’ is set to ‘Yes’ and the ‘I agree with the Terms and Conditions’ box is checked... but this is not as desperate.