Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Problem with checking session end in php.
Old 01-16-2010, 04:19 AM Problem with checking session end in php.
Isabella_Smith's Avatar
Ultra Talker

Posts: 285
Trades: 0
Hi guys,

Once again I am having problem, I put a simple code in admin panel for checking session out or not. But when I logged in it shows session expire.. Please let me know where I mistook.......here I am pasting some coding.

Please check the coding below:

PHP Code:
<?
include "includes/config.php";
$adminhome="activeTabhome";
if(
$_SESSION['adminid']!='' && is_numeric($_SESSION['adminid']) && $_SESSION['loginsession']=="exists")
{
?>
<html>
<head>
<title>Dial India Dial</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="css/style.css" rel="stylesheet" type="text/css" />
</head>
<body>

<<>>

<? include "includes/footer.php"?>
</body>
</html>
<?php
}
else{    
// Checking for the session expired or not.
    
if(headers_sent())
        print(
"<script language='javascript'>location.href = 'index.php?op=expired'</script>");
    else    
        
header("Location: index.php?op=expired");
    die;
}
?>
Thanks in advance for your consideration.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE



Please login or register to view this content. Registration is FREE
buy all indian salwar Kameez, Sarees and clothes

Last edited by Isabella_Smith; 01-16-2010 at 04:22 AM..
Isabella_Smith is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-16-2010, 06:26 AM Re: Problem with checking session end in php.
lizciz's Avatar
Super Spam Talker

Posts: 807
Name: Mattias Nordahl
Location: Sweden
Trades: 0
Well, then something in your if() statement returns false. Try to print out the $_SESSION array to see what the values really are.
PHP Code:
echo "<pre>";
print_r($_SESSION)
echo 
"</pre>"
EDIT: Just realised you have three identical threads. You do know that you can edit your posts, right?
__________________
Your answers will only be as good as your question. Formulate it well and give all the necessary information.

Last edited by lizciz; 01-16-2010 at 06:28 AM..
lizciz is offline
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Old 01-16-2010, 06:58 AM Re: Problem with checking session end in php.
Isabella_Smith's Avatar
Ultra Talker

Posts: 285
Trades: 0
Thanks lizciz,

I'll try your suggestions.

About the 3 post........yes I know I did this..........tell me how to delete them.......as there nothing to post if I edit them.

THanks!
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE



Please login or register to view this content. Registration is FREE
buy all indian salwar Kameez, Sarees and clothes
Isabella_Smith is offline
Reply With Quote
View Public Profile
 
Old 01-16-2010, 07:06 AM Re: Problem with checking session end in php.
Isabella_Smith's Avatar
Ultra Talker

Posts: 285
Trades: 0
Its working now...........thanks for your help...lizciz...
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE



Please login or register to view this content. Registration is FREE
buy all indian salwar Kameez, Sarees and clothes

Last edited by Isabella_Smith; 01-19-2010 at 02:39 AM..
Isabella_Smith is offline
Reply With Quote
View Public Profile
 
Old 01-16-2010, 08:23 PM Re: Problem with checking session end in php.
lizciz's Avatar
Super Spam Talker

Posts: 807
Name: Mattias Nordahl
Location: Sweden
Trades: 0
What do you mean "not showing any value"? That code snippet should print the content of the $_SESSION array, or if it's empty say it's NULL.
__________________
Your answers will only be as good as your question. Formulate it well and give all the necessary information.
lizciz is offline
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Reply     « Reply to Problem with checking session end in php.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.50025 seconds with 12 queries