[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to get my login status to appear immediately after I login?

Posted on 2011-05-02
2
Medium Priority
?
179 Views
Last Modified: 2012-05-11
Hi, I created a log in system so that when you log in it welcomes you at the top:

http://auroriella.com/login.php?

here log in as this user I am testing with:

user name: fairyqueen
password: hello

it says the login was successful but I have to refresh to get the welcome, fairyqueen at the top.  How do I get it to appear right after I log in??
<?php
require_once 'includes/library.php';
login_status();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php $title ?></title>
<link rel="stylesheet" href="jewels.css" type="text/css" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script type="text/javascript" src="includes/action.js"></script>
</head>

<body>
<div id="border">
<div id="content">
<div id="header">
<div id="account">
<a href="account.php<?php echo user_id() ?>">My Account</a> | <?php echo $status ?> <br />
<?php echo $welcome ?><br />
<a href="show_cart.php">Shopping Bag </a><br />

Open in new window

0
Comment
Question by:FairyBusiness
2 Comments
 
LVL 82

Accepted Solution

by:
hielo earned 2000 total points
ID: 35505572
In your login function, redirect to some other page after you have logged in - ex:

header('index.php');
exit();
0
 

Author Closing Comment

by:FairyBusiness
ID: 35505591
Good idea :)
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses
Course of the Month19 days, 5 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question