SunQuest
 
           PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old September 23rd, 2004, 12:43 AM
Qube Qube is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 3 Qube User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Session not registering

I have a simple login script running.. It queries the DB and then redirects the user to the their selected homepage. What I found was that it wasn't too secure, cause if the user knew the URL they could just go direct and lose some features. Solution was to create a Session to see if they logged in our not... Im still logging in and redirecting correctly though when I do the SESSION check it is not finding a match and echoing the user name

below extract from my login script
PHP Code:
if ($u && $p) {// If everything is OK, Lets Query the DB
$sql "SELECT Client, HomePage FROM details WHERE uid='$u' AND password='$p'";
$result mysql_query($sql);
$row mysql_fetch_array($resultMYSQL_NUM);
$homepage $row[1];
        
    if (
$row) {
//start the session, register the values & redirect
    
$_SESSION['Client'] = $row[0]; 

Extract from my user page, where I check if the session has been registered or not. This is not giving me the Client Name
PHP Code:
//Welcome the user by name if they are logged in
echo '<h1>Welcome';
if (isset(
$_SESSION['Client'])) {
    echo 
", {$_SESSION['Client']}!";
}
echo(
'</h1>');
?> 


in the subsequent pages I have create a file header.htm
which has the code
<?php
session_start();
?>

and the header code is called as an include
require_once('../header.htm');

Where I should I be looking for answers?

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > Session not registering


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway