Forum Moderators: coopster
What I have is a menu that I want a part of only shown to logged in members. I have tried if($loggedin == 1) echo with "'s and {'s in various places but I only get Parse error: syntax error, unexpected T_IF in /home/amiabl/public_html/cm/data.php on line 38.
Could someone tell me the proper way to form this operation?
Here is the line of code:
$config['footer'] = "<font color='#C0C0C0'><b>© {$config['site_name']}</font> ¦ <a href='privacy.php'>Privacy</a> ¦ <a href='tos.php'>TOS</a> ¦ <a target='_blank' href='{$config["forum"]}'>Forum</a> ¦ <a href='banner.php'>Banner</a> ¦ <a href='proof_of_payments.php'>Payments</a> ¦ <a href='purchase35.php'>Purchase Referrals</a> ¦ <a href='upgrade.php'>Upgrade</a><br><center></center>";
I want to start right after TOS displaying only to logged in members. Any help will be very much appreciated.
and welcome to WebmasterWorld!
As I can see you're mixing single and double quotes inside your statement. That is hell do debug.
You'd better use sprintf(), using single quotes only outside and double quotes only inside your sprintf() format (or vice versa):
$config['footer'] = sprintf('<font color="#C0C0C0"><b>© %s</font> ¦ <a href="privacy.php">Privacy</a> ¦ <a href="tos.php">TOS</a> ¦ <a target="_blank" href="%s">Forum</a> ¦ <a href="banner.php">Banner</a> ¦ <a href="proof_of_payments.php">Payments</a> ¦ <a href="purchase35.php">Purchase Referrals</a> ¦ <a href="upgrade.php">Upgrade</a><br><center></center>', $config['site_name'], $config["forum"]);
Hope that helps!