| | |
PHP Parse error: parse error, unexpected T_STRING
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jul 2005
Posts: 2
Reputation:
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?
<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> </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>
<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"> </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">
</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("Err
b");
##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>
</td>
</tr>
</table>
</div>
<p> </td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</body>
</html>
<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> </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>
<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"> </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">
</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("Err
b");##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>
</td>
</tr>
</table>
</div>
<p> </td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</body>
</html>
•
•
•
•
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?
•
•
•
•
echo ("<p>Please press the "Back" button and enter a valid Email address and a five number Zip Code.");
echo ("<p>Please press the \"Back\" button and enter a valid Email address and a five number Zip Code.");
Hope that helps?
•
•
Join Date: Jul 2005
Posts: 12
Reputation:
Solved Threads: 0
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...
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...
![]() |
Similar Threads
- parse error, unexpected T_STRING in (PHP)
- Parse error: parse error, unexpected T_STRING on line 12 (PHP)
- PHP Parse error: parse error, unexpected T_STRING in F:\downloads\cats-0.6.1\index.ph (PHP)
- Please Help! parse error, unexpected T_STRING (PHP)
- Parse Error T_STRING - Help Please (PHP)
- Parse error: parse error, unexpected T_STRING (PHP)
- Parse error: parse error, unexpected T_STRING in /home/thei2k9/public_html/includes/f (PHP)
Other Threads in the PHP Forum
- Previous Thread: help with creating form counter
- Next Thread: DB Tables
| Thread Tools | Search this Thread |
apache api array auto beginner binary broken cache cakephp checkbox class cms code codingproblem cron curl customizableitems database date display dynamic echo email error errorlog file files filter folder form format forms forum function functions gc_maxlifetime global google headmethod href htaccess html image include insert ip javascript joomla limit link login mail malfunctioning memmory memory menu method mlm multiple mysql nodes oop parameter parsing paypal pdf php phpmysql popup query radio random recursion recursiveloop remote script search select server sessions snippet source space sql static survey syntax system table trouble tutorial up-to-date update upload url validator variable video web youtube





