immanuelx2 Posted June 10, 2007 Share Posted June 10, 2007 Can someone please explain why this doesn't work and what I can do to fix it? echo '<li' . if ($page == "home") echo ' id="current"'; . '><a href="index.php">Home</a></li>'; Link to comment https://forums.phpfreaks.com/topic/55017-solved-jumping-in-and-out-of-php/ Share on other sites More sharing options...
Orio Posted June 10, 2007 Share Posted June 10, 2007 You can't have an if inside an echo... Try: <?php echo '<li'; if ($page == "home") echo ' id="current"'; echo '><a href="index.php">Home</a></li>'; ?> Orio. Link to comment https://forums.phpfreaks.com/topic/55017-solved-jumping-in-and-out-of-php/#findComment-271972 Share on other sites More sharing options...
immanuelx2 Posted June 10, 2007 Author Share Posted June 10, 2007 thank you Link to comment https://forums.phpfreaks.com/topic/55017-solved-jumping-in-and-out-of-php/#findComment-271974 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.