473,386 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Form problem

Hi there,

I'm a newbie on the php front but I've altered an email script to send a
bunch of information from a HTML form to an email address. Can anyone see
where I have gone wrong?

I am getting the following error:

Parse error: parse error, unexpected T_STRING in
/home/httpd/vhosts/yourdomain.com/httpdocs/test3/lifecover.php on line 62

I have posted the script below, any help would be muchly appreciated
(apologies if it is the worst script ever written!).

<?
$type=$_POST['type'];
$SingleJoint=$_POST['SingleJoint'];
$CoverReq=$_POST['CoverReq'];
$name=$_POST['name'];
$day=$_POST['day'];
$mn=$_POST['mn'];
$yr=$_POST['yr'];
$gen=$_POST['gen'];
$smoker=$_POST['smoker'];
$name1=$_POST['name1'];
$day1=$_POST['day1'];
$mn1=$_POST['mn1'];
$yr1=$_POST['yr1'];
$gen1=$_POST['gen1'];
$smoker1=$_POST['smoker1'];
$years=$_POST['years'];
$pay=$_POST['pay'];
$quotation=$_POST['quotation'];
$cover=$_POST['cover'];
$waiver=$_POST['waiver'];
$phn=$_POST['phn'];
$time=$_POST['time'];
$email=$_POST['email'];
$to="ne**@yourdomain.com";
$from="$email";
$message=" Application Type : $type\n\n
Single or Joint : $SingleJoint\n\n
Cover Required : $CoverReq\n\n

Personal Details :\n\n
Name : $name\n\n
DOB : $day/$mn/$yr\n\n
Gender : $gen\n\n
Smoker : $smoker\n\n\n\n

Partner Details :\n\n
Name : $name1\n\n
DOB : $day1/$mn1/$yr1\n\n
Gender : $gen1\n\n
Smoker : $smoker1\n\n\n\n

Policy Information :\n\n
Terms of Policy : $years\n\n
Do you wish to pay : $pay\n\n
Quotation based on: $quotation\n\n
Cover to : $cover\n\n
Waiver of premium : $waiver\n\n\n\n

Contact Details :\n\n
Phone : $phn\n\n
Time to call : $dtime\n\n
Email Address : $email\n\n;

if (mail($to, "Customer Information", "$message\n", "From: $from"))
{$URL="http://www.yourdomain.com/test3/thankyou.htm";header ("Location:
$URL");
} else {
echo "There was a problem sending the mail. Please check that you filled in
the form correctly.";
}
?>

--
Regards,

Neil McDermott
01604 627593
07841 865970
www.easiserv.com

--
Regards,

Neil McDermott
01604 627593
07841 865970
www.easiserv.com
Jul 17 '05 #1
2 1581

Neil McDermott wrote:
Hi there,

I'm a newbie on the php front but I've altered an email script to send a bunch of information from a HTML form to an email address. Can anyone see where I have gone wrong?

I am getting the following error:

Parse error: parse error, unexpected T_STRING in
/home/httpd/vhosts/yourdomain.com/httpdocs/test3/lifecover.php on line 62
I have posted the script below, any help would be muchly appreciated
(apologies if it is the worst script ever written!).

<?
$type=$_POST['type'];
$SingleJoint=$_POST['SingleJoint'];
$CoverReq=$_POST['CoverReq'];
$name=$_POST['name'];
$day=$_POST['day'];
$mn=$_POST['mn'];
$yr=$_POST['yr'];
$gen=$_POST['gen'];
$smoker=$_POST['smoker'];
$name1=$_POST['name1'];
$day1=$_POST['day1'];
$mn1=$_POST['mn1'];
$yr1=$_POST['yr1'];
$gen1=$_POST['gen1'];
$smoker1=$_POST['smoker1'];
$years=$_POST['years'];
$pay=$_POST['pay'];
$quotation=$_POST['quotation'];
$cover=$_POST['cover'];
$waiver=$_POST['waiver'];
$phn=$_POST['phn'];
$time=$_POST['time'];
$email=$_POST['email'];
$to="ne**@yourdomain.com";
$from="$email";
$message=" Application Type : $type\n\n
Single or Joint : $SingleJoint\n\n
Cover Required : $CoverReq\n\n

Personal Details :\n\n
Name : $name\n\n
DOB : $day/$mn/$yr\n\n
Gender : $gen\n\n
Smoker : $smoker\n\n\n\n

Partner Details :\n\n
Name : $name1\n\n
DOB : $day1/$mn1/$yr1\n\n
Gender : $gen1\n\n
Smoker : $smoker1\n\n\n\n

Policy Information :\n\n
Terms of Policy : $years\n\n
Do you wish to pay : $pay\n\n
Quotation based on: $quotation\n\n
Cover to : $cover\n\n
Waiver of premium : $waiver\n\n\n\n

Contact Details :\n\n
Phone : $phn\n\n
Time to call : $dtime\n\n
Email Address : $email\n\n;


You're missing the closing quote on the above line.

When you get an error like this, look on the line previous to the one
mentioned for the problem. It usually means you have a end quote
missing.

Ken

Jul 17 '05 #2
Cheers for that Ken, is there anyway that I can insert html tags so that the
titles
of the email come out in bold e.g. <b>Application Type</b>. At the moment
this just shows the tags as if they were text.

--
Regards,

Neil McDermott
01604 627593
07841 865970
www.easiserv.com
"Ken Robinson" <ke******@rbnsn.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...

Neil McDermott wrote:
Hi there,

I'm a newbie on the php front but I've altered an email script to

send a
bunch of information from a HTML form to an email address. Can

anyone see
where I have gone wrong?

I am getting the following error:

Parse error: parse error, unexpected T_STRING in
/home/httpd/vhosts/yourdomain.com/httpdocs/test3/lifecover.php on

line 62

I have posted the script below, any help would be muchly appreciated
(apologies if it is the worst script ever written!).

<?
$type=$_POST['type'];
$SingleJoint=$_POST['SingleJoint'];
$CoverReq=$_POST['CoverReq'];
$name=$_POST['name'];
$day=$_POST['day'];
$mn=$_POST['mn'];
$yr=$_POST['yr'];
$gen=$_POST['gen'];
$smoker=$_POST['smoker'];
$name1=$_POST['name1'];
$day1=$_POST['day1'];
$mn1=$_POST['mn1'];
$yr1=$_POST['yr1'];
$gen1=$_POST['gen1'];
$smoker1=$_POST['smoker1'];
$years=$_POST['years'];
$pay=$_POST['pay'];
$quotation=$_POST['quotation'];
$cover=$_POST['cover'];
$waiver=$_POST['waiver'];
$phn=$_POST['phn'];
$time=$_POST['time'];
$email=$_POST['email'];
$to="ne**@yourdomain.com";
$from="$email";
$message=" Application Type : $type\n\n
Single or Joint : $SingleJoint\n\n
Cover Required : $CoverReq\n\n

Personal Details :\n\n
Name : $name\n\n
DOB : $day/$mn/$yr\n\n
Gender : $gen\n\n
Smoker : $smoker\n\n\n\n

Partner Details :\n\n
Name : $name1\n\n
DOB : $day1/$mn1/$yr1\n\n
Gender : $gen1\n\n
Smoker : $smoker1\n\n\n\n

Policy Information :\n\n
Terms of Policy : $years\n\n
Do you wish to pay : $pay\n\n
Quotation based on: $quotation\n\n
Cover to : $cover\n\n
Waiver of premium : $waiver\n\n\n\n

Contact Details :\n\n
Phone : $phn\n\n
Time to call : $dtime\n\n
Email Address : $email\n\n;


You're missing the closing quote on the above line.

When you get an error like this, look on the line previous to the one
mentioned for the problem. It usually means you have a end quote
missing.

Ken

Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Richard | last post by:
Hi, I have a form that take some time to load due to many comboboxes and at least 8 subforms. When I filter or sort the main form I get an error message and then Access shuts down. They ask if...
15
by: Steve | last post by:
I have a form with about 25 fields. In the BeforeUpdate event of the form, I have code that sets the default value of each field to its current value. For a new record, I can put the focus in any...
5
by: Steve Strik | last post by:
My Problem: I have created a database here at work that is exhibiting some very strange behaviour. Essentially the database is structured in a manner where one table is a master record table...
1
by: Nico | last post by:
Hi! I use Windows XP and Access 2002 (XP) SP2 (not SP3) My company has not upgraded to SP3. My problem: -I have a form "F_BOMs" -in this form, i have a sub form called "SF_BOMs" -the sub-form...
3
by: dixie | last post by:
I have an Access 2000 form which has been running OK for a long time. Lately, it is playing up and doing things like causing Access to close suddenly when the form is opened or when saving the form...
9
by: Lyn | last post by:
Hi, I have a form which is opened from a button on another form. The form is used to display a list of records from a recordset in Continuous Mode. It is sized vertically to display about 25...
5
by: ortaias | last post by:
I have a form which calls up a second form for purposes of data entry. When closing the data entry form and returning to the main form, things don't work as expected. When I return to the main...
11
by: ChrisM | last post by:
Hi, Don't know if anyone can cast any light on this... I have a fairly complex C# WinForm with (amongst other) a text box and a button. The TextBox has events declared for KeyUp and KeyDown,...
0
by: hmm | last post by:
Hi all I have two problems: Problem #1: I'm using a .NET Form with the property 'FormBorderStyle' set to 'None'. The idea is to completely cover the area of that Form with a UserControl. In...
1
by: fugaki | last post by:
Hi everyone I'm learning asp, and i downloaded this script to teach me how to post form data from a webpage to an access database. I put it on the server so i could make sure that it worked, and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.