Displaying username in every page..

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 53
Joined: Wed Oct 10, 2012 12:14 am

Mon Oct 29, 2012 11:10 pm

//set the $_SESSION['signed_in'] variable to TRUE  
$_SESSION['signed_in'] = true; 

//Put the username values in the $_SESSION, so we can use it at various pages 
$_SESSION['username] = ... 

//check if the user is already signed in...  
if($_SESSION['signed_in'])  {  
echo 'Hello' . $_SESSION['username']...

New php-forum User
New php-forum User
Posts: 20
Joined: Fri Oct 19, 2012 4:32 am
Location: India

Tue Oct 30, 2012 4:47 am

<?php require_once('core/db.php'); require_once('core/secure.php'); $query = mysql_query("SELECT username FROM admin WHERE id = 1"); $username = mysql_fetch_array($query); ?><?php echo $username[username]; ?>

hire php developer | hire magento developer

Post Reply
  • Information
  • Who is online

    Users browsing this forum: Baidu [Spider], Wasem1968 and 5 guests