RSS Forums RSS
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 18449 | Replies: 3
Reply
Join Date: Jul 2005
Posts: 2
Reputation: Edward655 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Edward655 Edward655 is offline Offline
Newbie Poster

PHP Parse error: parse error, unexpected T_STRING

  #1  
Jul 25th, 2005
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>
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jul 2005
Location: Varaždin, Croatia, Europe
Posts: 14
Reputation: MadDogSh is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 1
MadDogSh's Avatar
MadDogSh MadDogSh is offline Offline
Newbie Poster

Re: PHP Parse error: parse error, unexpected T_STRING

  #2  
Jul 25th, 2005
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:

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?
Reply With Quote  
Join Date: Jul 2005
Posts: 12
Reputation: bgharper is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
bgharper bgharper is offline Offline
Newbie Poster

Re: PHP Parse error: parse error, unexpected T_STRING

  #3  
Jul 25th, 2005
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...
Reply With Quote  
Join Date: Jul 2005
Posts: 2
Reputation: Edward655 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Edward655 Edward655 is offline Offline
Newbie Poster

Solution Re: PHP Parse error: parse error, unexpected T_STRING

  #4  
Jul 25th, 2005
Thanks guys. I guess sometimes a fresh set of eyes are induplicable! That was the issue :o . Have a great week!
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 11:51 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC