I've just started php, and this is a class assignment, but my question is I’m getting this error PHP Parse error: syntax error, unexpected T_IF, expecting T_VARIABLE or '$' in C:\wamp\www\ssp \SSP04\guessing Game.php on line 42. I’ve tried to make sense of it but I’m at a lose, there error is referring to this segment of the code.
[PHP]else{
if(!isset($_GET['word'])){
echo "<p>****</p>";
$guess = "****";
}//end if
//declaring some vaiables.
$guessedWord = $_GET['word'];
$guess = $_GET['letter']; //this is line 42
$secretArray = str_split($secr etWord, 1);
$guessedArray = str_split($gues sedWord, 1);
[/PHP]
this code is being called by a form
what I don't understand is that all of the if statements have been closed and there isn't a if statement on that line, though i know that sometime the error could be a few lines up...If anyone could please point me in the right direction it would be a great help
Thanks Praclarush
[PHP]else{
if(!isset($_GET['word'])){
echo "<p>****</p>";
$guess = "****";
}//end if
//declaring some vaiables.
$guessedWord = $_GET['word'];
$guess = $_GET['letter']; //this is line 42
$secretArray = str_split($secr etWord, 1);
$guessedArray = str_split($gues sedWord, 1);
[/PHP]
this code is being called by a form
what I don't understand is that all of the if statements have been closed and there isn't a if statement on that line, though i know that sometime the error could be a few lines up...If anyone could please point me in the right direction it would be a great help
Thanks Praclarush
Comment