473,473 Members | 1,584 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

logout script not functioning

20 New Member
I have created a log in system and logging in is functioning but logging out is not working its showing error warnings.

logout.php
[PHP]
<?
//include function files for this application
require_once("system_fns.php");
session_start();
$old_user = $valid_user; //store to test if *were* logged in
$result_unreg = session_unregister("valid_user");
$result_dest = session_destroy();
//start output html
do_html_header("Logging Out");

if(!empty ($old user))
{
if($result_unreg && result_dest)
{
//if they were logged in and are now logged out
echo "Logged Out.<br>";
do_html_url("login.php", "Login");
}
else
{
//they were logged in and could not be logged out
echo "Could not log you out.<br>";
}
}
else
{
//if they were logged in but came to this page somehow
echo "You were not logged in, and so you have been logged out.<br>";
do_html_url("login.php", "Login");
}
?>
[/PHP]

This is the error I'm getting.
Parse error: parse error, unexpected T_STRING, expecting ')' in C:\project\test\logout.php on line 11
Here is code at line 11
[PHP]
if(!empty ($old user))
[/PHP]
Any is greatly appreciated.
Feb 15 '07 #1
2 2021
aniltc
17 New Member
I have created a log in system and logging in is functioning but logging out is not working its showing error warnings.

logout.php
[PHP]
<?
//include function files for this application
require_once("system_fns.php");
session_start();
$old_user = $valid_user; //store to test if *were* logged in
$result_unreg = session_unregister("valid_user");
$result_dest = session_destroy();
//start output html
do_html_header("Logging Out");

if(!empty ($old user))
{
if($result_unreg && result_dest)
{
//if they were logged in and are now logged out
echo "Logged Out.<br>";
do_html_url("login.php", "Login");
}
else
{
//they were logged in and could not be logged out
echo "Could not log you out.<br>";
}
}
else
{
//if they were logged in but came to this page somehow
echo "You were not logged in, and so you have been logged out.<br>";
do_html_url("login.php", "Login");
}
?>
[/PHP]

This is the error I'm getting.
Parse error: parse error, unexpected T_STRING, expecting ')' in C:\project\test\logout.php on line 11
Here is code at line 11
[PHP]
if(!empty ($old user))
[/PHP]
Any is greatly appreciated.
check this page
[PHP] do_html_header("Logging Out");[/PHP]
i am not able to see any extensions here
Feb 16 '07 #2
muchexie
20 New Member
check this page
[PHP] do_html_header("Logging Out");[/PHP]
i am not able to see any extensions here
Maybe I did not get your question right but the way I understand this code.
[PHP]
do_html_header("Logging Out");
[/PHP]
It only outputs the statement Logging Out.I don't think it should have the extensions you are talking about.
Feb 16 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Harlin Seritt | last post by:
I have a remote linux server where I can only access it via ssh. I have a script that I need to have run all the time. I run like so: python script.py & It runs fine. When I log off ssh I...
0
by: ZMan | last post by:
Scenario: This is about debugging server side scripts that make calls to middle-tier business DLLs. The server side scripts are legacy ASP 3.0 pages, and the DLLs are managed DLLs...
5
by: Michael D. Jones | last post by:
Hi all, I would like to have a delay on a logout page. Here is what I have so far: logout.aspx ----------- Page_Load() FormsAuthentication.SignOut(); Thread.Sleep(5000);
12
kamill
by: kamill | last post by:
I have done a logout page for logout from admin section and provides a link to logout from admin section.Whenever i clicked on logout link it redirected to index.php of admin section......BUT when i...
7
by: pank | last post by:
hey guys ... can anybody tell me a php logout script. I want to log out from one page which i was developing , i tried but it's not working. I have tried session_destroy(),session_unset()...
7
by: thesti | last post by:
hi, i'm learning and trying to develop a web with php. the logout script of mine seems not working since that after i pressed the logout link. i still get the greeting "welcome, 'username' ". ...
6
by: Thiago Macedo | last post by:
I could not find on the web a complete solution for this task. This is not the perfect solution, because it's doesn't have the ability to log the logout if browser crash or user leave it open while...
10
by: DavidPr | last post by:
When I logout as one user and log in under a different user, it opens with the last user's information. User 1 - Unsername: Davey Jones User 2 - Unsername: David Smith I log out from Davey...
1
by: phpuser123 | last post by:
Hi,I have created a script where I want to use onclick event and javascript to log out.Here r my coodes .. <script type="text/javascript"> function logout(){ <?php...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.