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>'; Quote 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. Quote 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 Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.