Hello,
Can any one tell me that how to show the name of the user using session. PLease help me by giving a code example and can anyone tell me i am using sessions and it is giving me this error "
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent" i have also used ob_start("ob_gzhandler"); but its not working.Thanks in advance

Recommended Answers

All 9 Replies

Use session_start() as the first command in your code.

Use session_start() as the first command in your code.

i have used session_start() but its not working

Show your code.

<?php
ob_start("ob_gzhandler");
session_start();
//if(!session_is_registered('$username')){
////header("location:index.php");
//}
//$user=$_REQUEST;
?>

Put session_start() first, as stated in my first post.

thanks i have solved the session_start() problem. Can u please help me in making a script for remembering the user logged in and displaying the name of the user

You can store your username in $_SESSION['username'] .

can u pleaase give me a detailed example of how to store the name of the user in session variable and show it on the page when logged in

Thanks a lot pritaeas i have solved my problem

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.