Im a novice at php and cant seem to get the following two line together.

We want to use this line

<?php if($logged_in) { echo "Welcome back, $logged_row[username]&nbsp"; } else {

print('<a href="http://xxx/login.html">Login</a> / <a href="http://xxx.com/signup.html">Signup</a>');

} ?>

But we need this put into it, we need it before the else statement.

<a href="<?= $_SERVER["REQUEST_URI"] . '&amp;action=logout' ?>"><?= $lang['ACC_LOGOUT'] ?></a>

Any help would be greatly appreciated.

Recommended Answers

All 2 Replies

<?php 
if($logged_in) { 
  echo "Welcome back, $logged_row[username]&nbsp"; 
 ?>
<a href="<?= $_SERVER["REQUEST_URI"] . '&amp;action=logout' ?>"><?= $lang['ACC_LOGOUT'] ?></a>
<?php
} 
else {
 print('<a href="http://xxx/login.html">Login</a> / <a href="http://xxx.com/signup.html">Signup</a>');
} 
?>

Thank you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.