954,604 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

PHP Parse error: parse error, unexpected T_STRING






Please confirm your entry below so that we may correctly process your information to our Sales Agents and Investors.

  Confirmation  

Submitted
Information:

<?php include "clsMyClass.php"; $myclass = &New MyClass; $fname = $_POST['fname']; $lname = $_POST['lname']; $email = $_POST['email']; $phone = $_POST['phone']; $fax = $_POST['fax']; $cash = $_POST['cash']; $duedate = $_POST['deudate']; $forcdate = $_POST['forcdate']; $assessedv = $_POST['assessedv']; $compmin = $_POST['compmin']; $compavg = $_POST['compavg']; $negprice = $_POST['negprice']; $street = $_POST['street']; $city = $_POST['city']; $state = $_POST['state']; $zip = $_POST['zip']; $comments = $_POST['comments']; $myclass->Email = $email; $myclass->Zip = $zip; $check_email = $myclass->check_email(); $check_zip = $myclass->check_zip(); ##Ensure all fields have entries if($check_email and $check_zip) { ##connect to mysql $conn = mysql_connect("mysqldb","xxxxxxx","yyyyyyy") or die("Err:Conn"); ##select the database $rs=mysql_select_db("zzzzzzzzz", $conn) or die("Err:Db"); ##create the query $sql="insert connect (fname, lname, email, phone, fax, cash, duedate, forcdate, assessedv, compmin, compavg, negprice, street, city, state, zip, comments) values( \"$fname\", \"$lname\", \"$email\", \"$phone\", \"$fax\", \"$cash\", \"$duedate\", \"$forcdate\", \"$assessedv\", \"$compmin\", \"$compavg\", \"$negprice\", \"$street\", \"$city\", \"$state\", \"$zip\", \"$comments\" )"; ##execute the Query $rs=mysql_query($sql, $conn); ##confirm the added record details if($rs) { echo("

Your First Name: ");
echo($fname);
echo("
Your Last Name: ");
echo($lname);
echo("
Your Email Address: ");
echo($email);
echo("
Your Phone Number: ");
echo($phone);
echo("
Your Fax Number: ");
echo($fax);
echo("
Amount Requested: ");
echo($cash);
echo("
Amount Needed By: ");
echo($duedate);
echo("
Date of Foreclosure: ");
echo($forcdate);
echo("
Property Assessed Value: ");
echo($assessedv);
echo("
Property Minimum Comp: ");
echo($compmin);
echo("
Property Average Comp: ");
echo($compavg);
echo("
Negotiated Purchase Price: ");
echo($negprice);
echo("
Property Street Name: ");
echo($street);
echo("
Property City: ");
echo($city);
echo("
Property State: ");
echo($state);
echo("
Property Zip Code: ");
echo($zip);
echo("
Additional Comments: ");
echo($comments);
};
}

else #if Email is Blank or Zip is the wrong length
{
echo ("

Please press the "Back" button and enter a valid Email address and a five number Zip Code.");
}
?>




 




 



Edward655
Newbie Poster
2 posts since Jul 2005
Reputation Points: 10
Solved Threads: 0
 
I got this error: "PHP Parse error: parse error, unexpected T_STRING on line 137" from the following code and I am not sure what is wrong iwth it. Any suggestions?

Well... I tried to locate line 137, and what I got was this:echo ("Please press the "Back" button and enter a valid Email address and a five number Zip Code.");

And after a short reconsideration, I came up with this correction that should work:

echo ("Please press the \"Back\" button and enter a valid Email address and a five number Zip Code.");

Hope that helps? :?:

MadDogSh
Newbie Poster
15 posts since Jul 2005
Reputation Points: 11
Solved Threads: 1
 

Anytime you use quotes (") that you want the end user to see, always put backslashes before.

If you often forget, I have found you can use single quotes and not have to use backslashes...example...

Instead of this...[PHP]<?php echo "Press the \"Back\" button"; ?>[/PHP]

You could probably use [PHP]<?php echo 'Press the "Back" button'; ?>[/PHP]

Perhaps Troy knows a bit more about this...

bgharper
Newbie Poster
12 posts since Jul 2005
Reputation Points: 11
Solved Threads: 0
 

Thanks guys. I guess sometimes a fresh set of eyes are induplicable! That was the issue :o . Have a great week!

Edward655
Newbie Poster
2 posts since Jul 2005
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You