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
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...

Link to comment
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...

Example please? And a newbie explanation please xD

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.