954,591 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

parse error: parse error, unexpected $ in /www

Hi,
I have a webpage that displays different info at different times of day,
it worked fine until i put flash on my page,
i used tutorial on how to remove "click to activate" in updated IE.
here: http://www.gerozahn.de/click-workaround/

then I tried to use my code to display different info according to time,
i used this code, which works fine without "click to activate" fix:

<?php
$hour = date('G'); //This outputs the current hour in 0 - 23 (24 hour format)
if($hour >= 21 || $hour <= 0)
{
?>
........................my webpage..............................
}
else
{
?>
........................another webpage.......................



then I tried to use "click to activate" fix with the above code like this:

<?php
  ob_start();
?>
<?php
$hour = date('G'); //This outputs the current hour in 0 - 23 (24 hour format)
if($hour >= 21 || $hour <= 0)
{
?>
........................webpage with flash..............................
}
else
{
?>
........................another webpage with flash.......................
<?php
  include_once "replaceObjEmbed.php";
  echo replaceObjEmbed(ob_get_clean());
?>     <strong><------ parse error here, unexpected $</strong>


i even tried to switch them around but still i get the parse error,
"click to activate" fix works fine on a single page though
please help!
thank you

jcisml
Newbie Poster
6 posts since Nov 2006
Reputation Points: 10
Solved Threads: 0
 
<?php
  ob_start();
?>
<?php
$hour = date('G'); //This outputs the current hour in 0 - 23 (24 hour format)
if($hour >= 21 || $hour <= 0)
{
?>
........................webpage with flash..............................
<strong><?php <--- You're missing this</strong>
}
else
{
?>
........................another webpage with flash.......................
<?php
  include_once "replaceObjEmbed.php";
  echo replaceObjEmbed(ob_get_clean());
?>
stymiee
He's No Good To Me Dead
Moderator
3,360 posts since May 2006
Reputation Points: 161
Solved Threads: 38
 

hi!
thanks for the reply,
i've tried your suggestion but it still gives parse error
here is the file, if you could kindly please check out,
thanks
http://dalerlife.net/file.zip

jcisml
Newbie Poster
6 posts since Nov 2006
Reputation Points: 10
Solved Threads: 0
 

Maybe your problem is not with that script but with replaceObjEmbed.php. Try checking it, maybe that's where the problem is.

jblacdao
Light Poster
37 posts since Jan 2007
Reputation Points: 12
Solved Threads: 3
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You