cluce Posted June 14, 2007 Share Posted June 14, 2007 can someone tell me the correct way to code this statement. I am rusty with HTML and php together ... <?php if ($priv === true) { <a href="post_topic.php">update_banner</a> };?> Link to comment https://forums.phpfreaks.com/topic/55604-solved-syntax-error-in-small-code-snippet/ Share on other sites More sharing options...
simcoweb Posted June 14, 2007 Share Posted June 14, 2007 Change to this: <?php if ($priv === true) { echo "<a href="post_topic.php">update_banner</a>"; } ?> Link to comment https://forums.phpfreaks.com/topic/55604-solved-syntax-error-in-small-code-snippet/#findComment-274719 Share on other sites More sharing options...
kenrbnsn Posted June 14, 2007 Share Posted June 14, 2007 You can do it multiple different ways. Here are two: <?php if ($priv === true) { echo '<a href="post_topic.php">update_banner</a>'; } ?> or <?php if ($priv === true) { ?> <a href="post_topic.php">update_banner</a> <?php } ?> Ken Link to comment https://forums.phpfreaks.com/topic/55604-solved-syntax-error-in-small-code-snippet/#findComment-274722 Share on other sites More sharing options...
cluce Posted June 14, 2007 Author Share Posted June 14, 2007 thats right thanx Link to comment https://forums.phpfreaks.com/topic/55604-solved-syntax-error-in-small-code-snippet/#findComment-274741 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.