close ad
WARNING PC USERS: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Welcome Page with login name

Thread began 2/20/2011 8:00 pm by madelectrical386948 | Last modified 3/01/2011 2:51 pm by Jason Byrnes | 2262 views | 16 replies |

madelectrical386948

Welcome Page with login name

I completed the basic portion of the login page, but I am having a problem with showing the name of the login person.

I have it working on the local server, but I get a msg. Here is the code and after that, the msg I get from trying to run it.

Hopefully, somebody has an idea.

<?php if(!session_id()) session_start(); ?>
<?php echo $_SESSION['VisitorFirstName']; ?> <?php echo $_SESSION['VisitorLastName']; ?>


Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/cragdire/public_html/welcome.php:7) in /home/cragdire/public_html/welcome.php on line 46

thx

Mike

Sign in to reply to this post

Jason ByrnesWebAssist

this line:
<?php if(!session_id()) session_start(); ?>


should be at line 1 of your page.

You cannot call the session start function after any of the html on your page, it needs to be used in the head of the page, before there is any output code.

Sign in to reply to this post

madelectrical386948

Still need some help

Thanks for the Info Jason.

That worked getting rid of the error. Basically I had it working on the original spot on the local server and it changed when I made the new version. Wouldn't work.

I was on the right track with all my reading.

I would like to show the people who log on with their name. I have created a DB that has VisitorFirstName and VisitorLastName (other items in the DB).
I created Session variable with those name. I basically did the same thing on the local and it worked.

So can I tie the DB info into session variables?

If not, what is the best way to accomplish this.

thx

Mike D

Sign in to reply to this post

Jason ByrnesWebAssist

In the security assist authenticate user behavior on the login page, go to the third page, here you can select database columns to store in session variables at log in.

select the first name and last name columns to have them stored at log in.


you can then use those session on the other pages to display the logged in users first name and last name.

Sign in to reply to this post

madelectrical386948

Oh Boy

I feel really stupid. I completly forgot that part.

Thanks Jason.

Mike

Sign in to reply to this post

madelectrical386948

One More Step

I forgot to ask.

Once I logon. How do you pick the time frame for an automatic logout?

Also, If I logout and log in with another user, it still shows the original first and last name.

I know that sessions run out in 20 min's, but is there a command to clear the session?

If so, where do I put it?

Again, thanks for your help.

Mike

Sign in to reply to this post

Jason ByrnesWebAssist

the only to force auto logout is with the session timeout settings, session timeout os set on the server:
12812.htm

your log out page should have the following code in it before the doctype tag to clear the sessions:

php:
<?php

if (!isset($_SESSION)) {
  
session_start();
}
?><?php 
if ("" == ""){
  
// WA_ClearSession
    
$clearAll TRUE;
    
$clearThese explode(",","");
    if(
$clearAll){
        foreach (
$_SESSION as $key => $value){
            unset(
$_SESSION[$key]);
        }
    }
    else{
        foreach(
$clearThese as $value){
            unset(
$_SESSION[$value]);
        }
    }
}
?>
Sign in to reply to this post

madelectrical386948

Perfect

Thanks Jason,

That is what I needed.

Mike

Sign in to reply to this post

Jason ByrnesWebAssist

You're welcome.

Sign in to reply to this post

eladgraphics386618

registration page not redirection well

I have setup my registration page to redirect to login page. I have checked many times and can not find where is the error. can someone please help me find where I am going wrong? thanks so much.

I have uploaded the site on "www.thelightfilmproduction.com"

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...