Jump to content

unexpected ;


Vivid Lust

Recommended Posts

  <?php
      while($i < $im ){
         $i = $i + 1;
         echo "<input type=/"checkbox/" name=/"bg/" value="/$iu[$i]/"";
         if($bg == /"$iu[$i]/"){ echo( "checked" ); } 
         echo ">";
      }
      ?>

 

your closing your php before the echo          if($bg == /"$iu[$i]/"){ echo( "checked" ); } ?>

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/130480-unexpected/#findComment-676878
Share on other sites

Actually, that won't cause the error the OP reported. The bigger problem is that the wrong character is used to escape the double quotes. It should be "\"  not "/", plus it's used too many times. Try:

<?php
	while($i < $im ){
		$i++;
		echo '<input type="checkbox" name="bg" value="' . $iu[$i] . '"';
		if($bg == $iu[$i]){ echo( "checked" ); }
		echo ">";
	}
	?>

 

By using the single quote, you can avoid escaping the double quote altogether.

 

Ken

Link to comment
https://forums.phpfreaks.com/topic/130480-unexpected/#findComment-676883
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.