Page 1 of 1

Parse error: syntax error, unexpected T_ELSE

Posted: Fri Sep 26, 2008 10:53 am
by bryaninfuze
Parse error: syntax error, unexpected T_ELSE in /home/infuze/public_html/templates/jw_inetgazette/index.php on line 55

I want to make a simple if statement say if your on the index page show a .swf file and if your not show the header image but I keep getting the error above...

here is the code.. any help will be much appreciated...

<script type="text/javascript" src="swfobject.js"></script>
<div id="flashcontent">
<img src="images/header.png" />
</div>

<script type="text/javascript">
var so = new SWFObject("banner2.swf", "index", "929", "96", "8", "#000");
so.write("flashcontent");
</script>;


<? if (url == index.php);

echo "<script language='javascript'>startdisplay();</script>";


else (url == NULL);
echo "<img src=/image/header.png>";


?>

Re: Parse error: syntax error, unexpected T_ELSE

Posted: Fri Sep 26, 2008 11:02 am
by thiscatis
if(condition) { //do something;}
else { //do something else; }

Re: Parse error: syntax error, unexpected T_ELSE

Posted: Fri Sep 26, 2008 11:17 am
by bryaninfuze
sorry im kind of a newbie can you explain so that i can understand?

right now im saying

if the url is index.php then execute this...

else the url is something other than index.php do something else...

i want it to show an image on every page but the index.php... and on the index.php page i want to show a .swf

Re: Parse error: syntax error, unexpected T_ELSE

Posted: Fri Sep 26, 2008 11:26 am
by bryaninfuze
never mind. thanks... its not throwing the error but I still can't see the .swf...any ideas? I think i might be calling my JavaScript wrong..

any help would be appreciated! Thanks guys!