For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > July 2004 > parse error









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author parse error
jrblast

2004-07-21, 4:54 pm

i get this error when visiting m iste in php (right now its not public just a test thing)
Parse error: parse error, unexpected T_STRING in /home/mdesigns/public_html/scpsyco/Public html/originalpsyco/index.php on line 34
the code to that page is

<HTML>
<HEAD>
<TITLE>Index</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1255">
<META NAME="keywords" CONTENT="Starcraft hacks, starcraft, sc, hacks, editors,utilz, maps,scm,scx,battle net">
<META NAME="description" CONTENT="All your Starcraft needs and more can be met here!!! more games coming soon">
<META NAME="author" CONTENT="Jrblast">

<link rel="stylesheet" type="text/css" href="css/css_template_1.css">

</HEAD>
<BODY BGCOLOR=#000000 LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 color="ccffcc">
<Font color="00cc00">

<TABLE WIDTH=720 BORDER=0 CELLPADDING=0 CELLSPACING=0>
<TR>
<TD COLSPAN=3>
<center><IMG SRC="images/page_template_01.gif" ALT=""></TD>
</TR>
<TR>
<TD ROWSPAN=2>
<IMG SRC="images/page_template_02.gif" BORDER=0 ALT="" USEMAP="#page_template_02_Map"><br>
</TD>
<TD WIDTH=799 HEIGHT=410 VALIGN=top BGCOLOR=#000000>

<?php


if (empty($area))

$area=index;
{}

print "<iframe src="content/$area_content.html" name="index" width="799" height="425" alt="" frameborder="0"></iframe>";

?>


</TD>
<TD width="120">

</TD>
<TR>
<TD>
<More Google ads>
</TD>
</tr>
</TABLE>
<MAP NAME="page_template_02_Map">
<AREA SHAPE="rect" ALT="Utilities for Starcraft" COORDS="34,99,165,130" HREF="utilz">
<AREA SHAPE="rect" ALT="Forum (Message boards)" COORDS="43,65,155,93" HREF="http://24.100.134.222">
<AREA SHAPE="rect" ALT="Home" COORDS="49,29,149,57" HREF="index">
<AREA SHAPE="rect" ALT="Miscellaneous" COORDS="59,279,139,312" HREF="misc">
<AREA SHAPE="rect" ALT="Scree Shots" COORDS="72,246,124,273" HREF="ss">
<AREA SHAPE="rect" ALT="Replays" COORDS="36,206,162,245" HREF="replay">
<AREA SHAPE="rect" ALT="Links" COORDS="54,173,144,201" HREF="index.php?area=links">
<AREA SHAPE="rect" ALT="Starcraft Maps" COORDS="54,136,143,171" HREF="maps">
</MAP>
<!-- End ImageReady Slices -->
</BODY>
</HTML><!-- text below generated by server. PLEASE REMOVE --></object></layer></div></span></style></noscript></table></script></applet>
<script language="JavaScript">var PUpage="76001084"; var PUprop="geocities"; </script><script language="JavaScript" src="http://www.geocities.com/js_source/pu5geo.js"></script><script language="JavaScript" src="http://www.geocities.com/js_source/ygIELib9.js?v3"></script><script language="JavaScript">var yviContents='http://us.toto.geo.yahoo.com/toto?s=76001084&l=NE&b=1&t=1089837289';yviR='us';yfiEA(0);</script><script language="JavaScript" src="http://us.i1.yimg.com/us.yimg.com/i/mc/mc.js"></script><script language="JavaScript" src="http://geocities.com/js_source/geov2.js"></script><script language="javascript">geovisit();</script><noscript><img src="http://visit.webhosting.yahoo.com/visit.gif?us1089837289" alt="setstats" border="0" width="1" height="1"></noscript>
<IMG SRC="http://geo.yahoo.com/serv?s=76001084&t=1089837289" ALT=1 WIDTH=1 HEIGHT=1>
Sebastian Lauwers

2004-07-22, 3:56 pm

jrblast wrote:

> if (empty($area))
>
> $area=index;
> {}


Now what is that? Please learn to code, and then code... That's always
SOME good advice...

<?php

if (empty ($area) ) {

$area = 'index';

}
?>

BTW, why do you an if statement as there is no other code that can
possibly change your $area?

Regards,
Sebastian

--
The most likely way for the world to be destroyed,
most experts agree, is by accident.
That's where we come in; we're computer professionals.
We cause accidents.
--Nathaniel Borenstein
jrblast

2004-07-23, 3:35 pm

ok i tried that it sorta worked... now im not getting an error from php but the variable is being sent to my browser as $area and not its value
Sebastian Lauwers

2004-07-23, 8:55 pm

jrblast wrote:
> ok i tried that it sorta worked... now im not getting an error from php


That's quite normal as you didn't escape you double-quotes.

> but the variable is being sent to my browser as $area and not its value


Try this instead:

<?php

if (empty ($area) ) {

$area = 'index';

}

echo '<iframe src="content/'.$area.'_content.html" name="index"
width="799" height="425" alt="" frameborder="0"></iframe>';

?>


That should do it.

HTH,
Best regards,
Sebastian

--
The most likely way for the world to be destroyed,
most experts agree, is by accident.
That's where we come in; we're computer professionals.
We cause accidents.
--Nathaniel Borenstein
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com