Page 1 of 1

Error In Script...Somewhere....

Posted: Mon Jun 26, 2006 9:55 pm
by watson516
I have been looking through this for quite awhile now and I can't see what is wrong with it, would be some great help if someone could point out the trouble spot. The follow code is where I receive the error...

Code: Select all

$lid = $_GET['lid'];
		$q = "SELECT * FROM masterlist WHERE list_id = $lid";
		$result = mysql_query($q);
        $row = mysql_fetch_array($result); 
		echo <<<DONE
			<form method="POST" action="panel.php?pid=6&val=$lid">
			<center>
			<table border="0" width="700" id="table1">
			<tr>
				<td width="50%">
					<p>
					<input name="item" size="4" style="float:right; text-align:right" value="{$row['list_id']}"></p>
				</td>
				<td><font face="Copperplate Gothic Bold" color="#FFFFFF">Item ID</font></td>
			</tr>
			<tr>
				<td>
					<input name="name" size="20" style="float:right; text-align:right" value="{$row['list_name']}"></td>
				<td><font face="Copperplate Gothic Bold" color="#FFFFFF">Item Name</font></td>
			</tr>
			<tr>
				<td align="center">
					<p align="right"><font face="Copperplate Gothic Bold" color="#C0C0C0">
					<b>{$row['list_pic']}.jpg</b></font></td>
				<td align="center">
					<p align="left">
					<font face="Copperplate Gothic Bold" size="4" color="#FFFFFF">Current 
						Picture Name</font></td>
/*Line 539*/		</tr>
			<tr>
				<td colspan="2">
					<p align="center">
					<input type="file" name="pic" size="20"></td>
			</tr>
			<tr>
				<td colspan="2">
					<p align="center"><input type="submit" value="Apply" name="B1"></td>
			</tr>
			</table>
			</center>
			</form>
DONE;
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/.bocephus/panel.php on line 539

Posted: Mon Jun 26, 2006 10:21 pm
by wildboyz_211
Well from what i see, this needs <? ?> or <?php ?> ( <b>{$row['list_pic']}.jpg</b> ) - like so:
<b><? {$row['list_pic']}.jpg ?></b>
And so does this ( {$row['list_name']} ):
<? {$row['list_name']} ?>
And this ( {$row['list_id']} )
<? {$row['list_id']} ?>

Unless you tried to put that whole HTML page in a ECHO command, then if in that case you might wanna not do that...i might need to see more of that script to figure it out...whats <<<DONE ???

Posted: Mon Jun 26, 2006 10:23 pm
by feyd
it's a heredoc, read the strings page on php.net for more information on it.