session login and logout

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ma5ect
Forum Commoner
Posts: 35
Joined: Wed Jun 25, 2008 8:38 am

session login and logout

Post by ma5ect »

Hi,

On my website i am trying to end a session and return to another page but i keep gettin this error..

Object not found!
The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.

If you think this is a server error, please contact the webmaster.


Code: Select all

<?
session_start();
if (!session_is_registered(myusername)) {
     header("location:mainlogin.php");
    }
?>
 
<html>
<head><title>Welcome</title>
</head>
<body>
<h1> Login successful</h1>
 
<p>
<a href="logout.php"> Log Out!</a></p>
 
 
</body>
</html>
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Re: session login and logout

Post by jayshields »

Try wrapping myusername in quotes?
ma5ect
Forum Commoner
Posts: 35
Joined: Wed Jun 25, 2008 8:38 am

Re: session login and logout

Post by ma5ect »

thanx for post...i have solved the problem
Post Reply