Jump to content

Best Approach printing this?


Dat

Recommended Posts

What is the best way to display this:

<?php if ($USER[loggedin] == true): ?>
Welcome to $SITE[sitename] $USERS[username], 
<?php endif; ?>

The arrays have values. My question is what is the best and easiest way to echo these arrays? Obviously you can place '<?php echo $SITE[sitename] ?>' but I want to know an alternative because I will be placing these arrays all over my site. It would be tedious work to place echoing and php syntax's everywhere.

Link to comment
https://forums.phpfreaks.com/topic/122488-best-approach-printing-this/
Share on other sites

What is the best way to display this:

<?php if ($USER[loggedin] == true): ?>
Welcome to $SITE[sitename] $USERS[username], 
<?php endif; ?>

The arrays have values. My question is what is the best and easiest way to echo these arrays? Obviously you can place '<?php echo $SITE[sitename] ?>' but I want to know an alternative because I will be placing these arrays all over my site. It would be tedious work to place echoing and php syntax's everywhere.

 

You can try create a page for your session() and include that file your session() in your every pages...

What is the best way to display this:

<?php if ($USER[loggedin] == true): ?>
Welcome to $SITE[sitename] $USERS[username], 
<?php endif; ?>

The arrays have values. My question is what is the best and easiest way to echo these arrays? Obviously you can place '<?php echo $SITE[sitename] ?>' but I want to know an alternative because I will be placing these arrays all over my site. It would be tedious work to place echoing and php syntax's everywhere.

 

You can try create a page for your session() and include that file your session() in your every pages...

Example please? And a newbie explanation please xD

I found that this approach is the best solution but there is a problem with it:

	if ($USERCAN[viewuserlist] == 1)
{
	$content = "<a href="$SITE[urlusers]/userlist.php">View Memberlist</a><br /><br /><br />
<b>User Links</b><br />
<a href="$SITE[urlusers]/logout.php">Logout</a><br />";
}

As you can I have to add \" to every freaken quote!

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.