Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more

Go Back   Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more > Web Programming > PHP Development
User Name
Password

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 10-13-2005, 08:29 PM   #1 (permalink)
que
Member
 
Join Date: Aug 2005
Posts: 31
Default session login only works once

I have a login form where action=login.php

login.php
Code:
..... session_start(); $_SESSION['logat']=0; ..... if ($db->num_rows()) { $_SESSION['logat']=1; echo("<script language='JavaScript'>"); echo("window.location.href='prof_main.php'"); echo("</script>"); } ?>
checkit.php
Code:
<?php if ($_SESSION['logat']!=1) { die ("Access denied!"); } ?>
It seems to work but once logged in but if I go to another page on my site where I wish to store some data it does not work. Any thoughts or ideas appreciated.
que is offline   Reply With Quote
Sponsored Links
Old 10-14-2005, 06:25 AM   #2 (permalink)
websitedatabases
Junior Member
 
Join Date: Jul 2005
Posts: 12
Default

Did you remember to session_start() on this page. Every page that uses $_SESSION must have a session_start() .

hth
websitedatabases is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

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

Points Per Thread View: 1.00
Points Per Thread: 11.00
Points Per Reply: 5.00



» Sponsors

» Links

» Affiliates
Web Hosting
Marketing Find
Merchant Select
SiteMap Builder
Host Compare
Dedicated Servers

» Links

» Sports Network
Paintball Forum
Football Forum
Hockey Forum
Golf Forum
Boxing Forum
Lacrosse Forum
Baseball Forum
SnowBoarding Forum
Soccer Forum
MMA Forum


All times are GMT -4. The time now is 04:00 AM.



LinkBacks Enabled by vBSEO 3.0.0 RC8
Webmaster Forums