944,055 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 29328
  • PHP RSS
Jul 25th, 2005
0

PHP Parse error: parse error, unexpected T_STRING

Expand Post »
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?

<html><head><title>RealProphet.com
</title>
</head>

<body>

<table border="0" cellpadding="5" cellspacing="0" width="100%">
<tr>
<td width="100%"><!--webbot bot="Include" U-Include="../include_head.htm"
TAG="BODY" -->

</td>
</tr>
</table>
<table border="0" cellpadding="5" cellspacing="0" width="100%">
<tr>
<td width="170" valign="top"><!--webbot bot="Include"
U-Include="../include_nav.htm" TAG="BODY" -->

<p>&nbsp;</td>
<td width="100%" valign="top">

<font face="Arial,Helvetica,sans-serif" size="-1">
<table cellSpacing="0" cellPadding="4" border="0">
<tbody>
</tbody>
</table>

</font>
<div align="justify">
<table border="0" cellpadding="0" cellspacing="0" width="580">
<tr>
<td width="578"><p><b><font face="Arial,Helvetica" size="+1" color="#840000">Please confirm your entry below so that we may correctly process your information to our Sales Agents and Investors.</font></b></p>

<p>&nbsp;
<div align="justify">
<table border="0" cellpadding="0" cellspacing="0" width="492">
<tr>
<td vAlign="top" align="left" width="95" bgColor="#FFFFFF" height="26" bordercolor="#FFFFFF">&nbsp;</td>
<td vAlign="top" align="left" width="547" bgColor="maroon" height="26"><img alt hspace="0" src="../images/corner-left.gif" align="left" border="0" width="6" height="5"><span style="float: left; color: #ffffff; padding-top: 2px; padding-bottom: 2px" class="P"><font face="Arial"><b>Confirmation
</b></font></span><img alt hspace="0" src="../images/corner-right.gif" align="right" border="0" width="6" height="5"></td>
</tr>
<tr>
<td vAlign="top" align="left" width="87" bgColor="#FFFFFF" height="128" bordercolor="#FFFFFF">&nbsp;
</td>
<td style="font-size: 8pt; border-left: 1px solid maroon; border-right: 1px solid maroon; border-bottom: 1px solid maroon; padding-left: 4px; padding-right: 4px; padding-top: 2px; padding-bottom: 2px" vAlign="top" align="left" width="539" bgColor="#EFEFEF" height="128">

<p style="word-spacing: 0; margin: 0"><font color="#08285A" face="Arial,Helvetica" size="-1"><b>Submitted
Information:</b></font></p>
<h2>
<?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("Errb");

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

else #if Email is Blank or Zip is the wrong length
{
echo ("<p>Please press the "Back" button and enter a valid Email address and a five number Zip Code.");
}
?>
</h2>
<p style="word-spacing: 0; margin: 0"><font face="Arial,Helvetica" size="-1">
<br>
&nbsp;
</td>
</tr>
</table>
</div>
<p>&nbsp;</td>
</tr>
</table>
</div>


</td>
</tr>
</table>

</body>

</html>
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Edward655 is offline Offline
2 posts
since Jul 2005
Jul 25th, 2005
1

Re: PHP Parse error: parse error, unexpected T_STRING

Quote originally posted by Edward655 ...
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:

Quote ...
echo ("<p>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 ("<p>Please press the \"Back\" button and enter a valid Email address and a five number Zip Code.");

Hope that helps?
Reputation Points: 11
Solved Threads: 1
Newbie Poster
MadDogSh is offline Offline
15 posts
since Jul 2005
Jul 25th, 2005
1

Re: PHP Parse error: parse error, unexpected T_STRING

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...
Reputation Points: 11
Solved Threads: 0
Newbie Poster
bgharper is offline Offline
12 posts
since Jul 2005
Jul 25th, 2005
0

Re: PHP Parse error: parse error, unexpected T_STRING

Thanks guys. I guess sometimes a fresh set of eyes are induplicable! That was the issue :o . Have a great week!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Edward655 is offline Offline
2 posts
since Jul 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: help with creating form counter
Next Thread in PHP Forum Timeline: DB Tables





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC