un known parsing error , plz help me ...
Posted by: isra2 (---.adsl.paltel.net)
Date: April 23, 2010 02:33PM

Hi all,

I'm a newbie to php and wamp , I'm trying to run an example named "try.php",
and gives a parsing error @ the line where i'm trien to refer a variable that i defined it

here is the code:


<?php
define ("AUTHOR", "Simon Stobart"winking smiley;
$hh = 1;
echo "<p>" . $_SERVER['DOCUMENT_ROOT'] . "</p>";
echo "Hello World";
 
while ($hh <= 10){
echo "<p>Iteration $intCount</p>";
$hh++;
}

?>


help mee ASAP, i'm workin on a project to be submitted 2night

thaanks in advance

Options: ReplyQuote
Re: un known parsing error , plz help me ...
Posted by: isra2 (---.adsl.paltel.net)
Date: April 23, 2010 03:38PM

The error was handled by changing the variable name to letters !!!!!!!!
how strange is this ....

Options: ReplyQuote
Re: un known parsing error , plz help me ...
Posted by: darkroomsource (---.or.wavecable.com)
Date: April 23, 2010 06:47PM

I don't know if you've figured this out yet.
It looks to me like you have not defined $intCount

You have a while loop that looks like this:
while ($hh <= 10){
echo "<p>Iteration $intCount</p>";
$hh++;
}

And maybe you meant it to look like this:
while ($hh <= 10){
echo "<p>Iteration $hh</p>";
$hh++;
}

and even just a little bit better:
while ($hh <= 10){
echo "<p>Iteration {$hh}</p>";
$hh++;
}

Options: ReplyQuote
Re: un known parsing error , plz help me ...
Posted by: isra2 (---.adsl.paltel.net)
Date: April 23, 2010 06:51PM

thanks darkroomsource, I figured this out
the error was in leaving spaces before the echo statement !!
donno y

Options: ReplyQuote


Sorry, only registered users may post in this forum.