Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form Fields PHP script error

Status
Not open for further replies.

PHPNovice

MIS
Oct 4, 2005
1
US
Hello,

I appologize ahead of time because I have never used php before but my boss needs an example project done for a conference he is presenting at.

I have created a Website where users enter information into a form and when a user press submit the information is suppose to be sent to the companies email address. When i attempt i press submit i am currently receiving the following error:

Parse error: parse error, unexpected ':' in C:\web\Apache2\htdocs\test.php on line 8

My code is:

<?php

$empID = $_REQUEST['empID'] ;
$Password = $_REQUEST['pass'];
$AccountSales = $_REQUEST['acct'];

mail( "example@yahoo.com", "Feedback Form Results", empID: $empID\nPassowrd: $pass\nAccountSales: $acct , "From: example@yahoo.com" );
header( "Location: );
?>

Like i said i have never used PHP before so any help you can provide would be appriciated. I have tried several different methods of submitting the form fields but they give me various errors like:

Parse error: parse error, unexpected T_STRING in C:\web\Apache2\htdocs\test.php on line 8

Thank you
 
You have bare text inside your invocation of mail(). Bare text is text that does not appear inside quotes.

Try:

mail( "example@yahoo.com", "Feedback Form Results", "empID: " . $empID . "\nPassowrd: " . $pass . "\nAccountSales: " . $acct , "From: example@yahoo.com" );


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top