Page 1 of 1

whats wrong?

Posted: Fri May 06, 2005 9:33 am
by rayquazadude
It says theres a parse error on line 71, but I dont know whats wrong. here's the exact error message:
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/vhosts/www.rayquazalair.net/cpanel.php on line 71

Code: Select all

print <<<EOT
	include(&quote;navigation.txt&quote;);
    <p>&nbsp;</p></td>
    <td width=&quote;99%&quote; valign=&quote;top&quote;><p align=&quote;center&quote;><head>
<div align=&quote;center&quote;>
  <center>

  </br>
  <table border=&quote;1&quote; cellpadding=&quote;0&quote; cellspacing=&quote;0&quote; style=&quote;border-collapse: collapse&quote; bordercolor=&quote;#111111&quote; width=&quote;90%&quote; height=&quote;1&quote;>
    <tr>
      <td width=&quote;100%&quote; height=&quote;1&quote; valign=&quote;top&quote; background=&quote;NewsBannerBG.PNG&quote;>
      <p align=&quote;center&quote;>
      <img border=&quote;0&quote; src=&quote;cpanel.png&quote; width=&quote;550&quote; height=&quote;79&quote;></td>

    </tr>

    <tr>

      <td width=&quote;100%&quote; height=&quote;1&quote; valign=&quote;top&quote; bgcolor=&quote;#283A58&quote;>

      

    </tr>

  </table>

  </center>
</div>
<div align=&quote;center&quote;>
  <center>
  <p></br>
  </p>

  <table border=&quote;1&quote; cellpadding=&quote;0&quote; cellspacing=&quote;0&quote; style=&quote;border-collapse: collapse&quote; bordercolor=&quote;#111111&quote; width=&quote;90%&quote;>
<tr>
<center><font size=&quote;2&quote; face=&quote;Tahoma&quote; color=&quote;#FFFFFF&quote;>EasyUpdate</font></center>
<td width=&quote;100%&quote; height=&quote;12&quote; face=&quote;Tahoma&quote; color=&quote;#FFFFFF&quote;background=&quote;newstitlebg.png&quote;><form action=&quote;postingupdate.php&quote; method=&quote;post&quote; name=&quote;updatetable&quote;>
<font size=&quote;1&quote; face=&quote;Tahoma&quote; color=&quote;#FFFFFF&quote;>&nbsp;&nbsp;<input name=&quote;title&quote; type=&quote;text&quote; value=&quote;Title&quote;> - Posted By $user on <input name=&quote;date&quote; type=&quote;text&quote; value=&quote;Date&quote;></font>
</td>
</tr>
<tr>
<td width=&quote;100%&quote; bgcolor=&quote;#004400&quote;><p align=&quote;justify&quote;><input type=&quote;text&quote; name=&quote;avatarpath&quote; value=&quote;Insert path to avatar&quote;>
  <textarea name=&quote;content&quote; cols=&quote;100&quote; rows=&quote;&quote;>Type content here</textarea>
</p>
<p align=&quote;center&quote;>-$user-</p>
<input name=&quote;isusernamevalid&quote; type=&quote;hidden&quote; value=&quote;valid&quote;>
<input name=&quote;username&quote; type=&quote;hidden&quote; value=&quote;$user&quote;>
<center><input type=&quote;submit&quote; value=&quote;Submit&quote;></center>
</form>
</td>
</tr>
</table>
  </center>
</div>
</table>
<br><center>
Enter name of file to edit: <form action=&quote;PHP_SELF&quote; method=&quote;post&quote;><select name=&quote;filename&quote;>
  <option>Choose a file to edit</option>
  <option value=&quote;affiliation.php&quote;>affiliation.php</option>
  <option value=&quote;contact.php&quote;>contact.php</option>
  <option value=&quote;copyright.txt&quote;>copyright.txt</option>
  <option value=&quote;dash.php&quote;>dash.php</option>
  <option value=&quote;dontclickhere.php&quote;>dontclickhere.php</option>
  <option value=&quote;emerald.php&quote;>emerald.php</option>
  <option value=&quote;links.php&quote;>links.php</option>
  <option value=&quote;mysprites.php&quote;>mysprites.php</option>
  <option value=&quote;navigation.txt&quote;>navigation.txt</option>
  <option value=&quote;polls.php&quote;>polls.php</option>
</select><input name=&quote;filedit&quote; type=&quote;hidden&quote; value=&quote;yes&quote;><input name=&quote;Edit&quote; type=&quote;submit&quote;></form>

$filename = $_POST&#1111;&quote;filename&quote;];
$filedit = $_POST&#1111;&quote;filedit&quote;];

if (filedit == yes){
$filecontent = file_get_contents($filename);
print &quote;<br><form action=/&quote;PHP_SELF/&quote; method=/&quote;post/&quote;><textarea name=/&quote;newcontent/&quote; cols=/&quote;/&quote; rows=/&quote;/&quote;>$filecontent</textarea><input name=/&quote;Submit/&quote; type=/&quote;submit/&quote;></form>&quote;;
}
$newcontent = $_POST&#1111;&quote;newcontent&quote;];
$handle2 = fopen($filename, &quote;wb&quote;);
    $numbytes = fwrite($handle2, $newcontent);
    fclose($handle2);
</center>
include(&quote;copyright.txt&quote;);    
<p align=&quote;center&quote;>&nbsp;</p>
EOT;

Posted: Fri May 06, 2005 9:48 am
by pickle
You're not closing your HEREDOC. Put "EOT;" (without the quotes of course) on line 70 and the problem should go away.

Posted: Fri May 06, 2005 9:57 am
by Skara
can you use includes inside heredoc? O.o

Posted: Fri May 06, 2005 9:59 am
by pickle
Nope, the only things you can have in heredoc's are text and variables (but not GLOBAL variables)

Posted: Fri May 06, 2005 10:07 am
by Skara
Then he has a lot more errors than a missing EOT;

rayquazadude: Using <<<EOT; ..text.. EOT; is just like using " ..text.. "
In other words, it's just printing the include() functions as text.