Programming Tools
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingProgramming Tools

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:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old December 11th, 2002, 05:40 PM
mytch mytch is offline
Dev Articles Novice (500 - 999 posts)
 
Join Date: Apr 2002
Location: Sydney, Australia
Posts: 589 mytch User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Article Discussion: Building a Members Area With PHP: Part 4/6

If you have any questions or comments about this article then please post them here.

This forum post relates to this article

Reply With Quote
  #2  
Old December 12th, 2002, 11:48 AM
phantom phantom is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 7 phantom User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
very nice

i am having one problem at the moment and that is users not being remembered. I don't know if this is because the code is not working or because of tripod but I am gonna work on it before I ask for help. Anyways another quality article ben, can't wait for the last two.

phantom

Reply With Quote
  #3  
Old December 12th, 2002, 04:10 PM
JXL JXL is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: Netherlands
Posts: 13 JXL User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
it doesnt remember me also
and where do i get the full source code of the article (1-4)?

i think i messed around to much with mine heh

Reply With Quote
  #4  
Old December 18th, 2002, 06:19 AM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
its on the last page of articles 1, 2 & 4

Reply With Quote
  #5  
Old December 18th, 2002, 10:29 AM
[krim] [krim] is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: latvia
Posts: 4 [krim] User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
gxm... you say that your support page help me to get full code of this and others scripts, BUT i and many more your guests downloading your support i saw abrakadabra (compressed file). We can't view it. Rebuild your support!!!

Reply With Quote
  #6  
Old December 30th, 2002, 03:55 AM
msmetsers msmetsers is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Location: netherlands
Posts: 11 msmetsers User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Ben, hope you had a nice xmas and that you're back....

Noticed that this thread is slowly dying....Please let's keep it going!

Have been working on it since the beginning, still don't get it all but am slowly but surely getting the hang of it. Interesting material.

Any chance of seeing the next 2 articles in the foreseeable future?
Thanks and best wishes for a healthy 2003!
Martin
The Netherlands

Reply With Quote
  #7  
Old December 30th, 2002, 10:43 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Quote:
Originally posted by [krim]
gxm... you say that your support page help me to get full code of this and others scripts, BUT i and many more your guests downloading your support i saw abrakadabra (compressed file). We can't view it. Rebuild your support!!!


URL [Articles 1&2]

URL [Articles 3]

And they work because i have tested it, if your getting a compressed file, thats because the file is ziped.

I'll be finishing off the articles shortly.

Reply With Quote
  #8  
Old January 9th, 2003, 04:46 PM
GreenHornet GreenHornet is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Posts: 16 GreenHornet User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Confused myself. Too tired to think...

Can anybody see the problem here.

The scriptperforms all functions - recognising me as being logged in but not storing a sessionid against the user is the user database named "gd_user", or writing the cookie for the session after logging in.

It does seem to log you in however

I have also renamed the mysql table from Bens article for the sessions as gd_session to suit the database.

I think the problem might lie somewhere in me having used code from a) the earlier 2 parts of the article, then b) the 4th article, but I cannot see where I am nuking the whole thing.

Have you guys at devArticles thought of writing a sleepdprivationscriptdebuggerPro for times like now?

Now I'll buy that for a dollar! (Total Recall - go Arnie!!)
Attached Files
File Type: txt completeloginscriptastext.txt (20.8 KB, 182 views)

Reply With Quote
  #9  
Old January 24th, 2003, 09:08 AM
yayaroon yayaroon is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 1 yayaroon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Login.php

I've downloaded the scripts, debugged with echo, and read through the forums for article 1,2,and4 but am still having problems getting a "Couldn't start new session" error. The registration is obviously working, the new users are added into the database table but the session info isn't coming through.

If I look at the Log database, however, I see entries like:

Login OK: [username], 1, [firstname], [ipaddress], 24/01/2003 09:59:01 AM

(where [username] = my user name, [firstname] = my firstname, [ipaddress] = my ip)

The support files for 1&2 don't give a login.php so I eventually tried using the login.php from supportfile from article 4.

The one thing I'm wondering is maybe I have a StoreSession problem

from the class.security.php file.

function Security()
{
$this->__LogTableName = 'tbl_Logs';
$this->__StoreSessionTableName = 'tbl_UserSession';
$this->__ExtraFieldNames = '';
$this->__FieldNameSess = 'sessId';
$this->__FieldNameUserId = 'userId';
$this->__FieldNameUser = 'username';
$this->__FieldNameSec = 'auth';

these values be renamed so that 'tbl_Logs' is replaced with 'log' (the name of the table in my database) and 'tbl_UserSession' be replaced by 'session' (the name of the session table in my database)?

Would I also change the 'sessId', 'userId' to the relevant values within the session table? ('sessionid' and 'userid')?

Many thanks,
J

Reply With Quote
  #10  
Old February 14th, 2003, 06:26 PM
DDDooGGG DDDooGGG is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Location: Melbourne, Australia
Posts: 97 DDDooGGG User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 m 33 sec
Reputation Power: 6
Hi,
The login script and creating a session and cookie all work. But when a user checks "remember me", they will get a cookie with the sessionid, but in the CheckCookie() function will stop at the following line:
PHP Code:
//cookie session = stored session, login
$result mysql_fetch_array($strQuery);
//echo $result['sessionid'];
if($dtlsSecurity->StoreSession($result[0], $result[1], $result[3], "{$result[4]},{$result[5]}")) <- STOPS AT THIS LINE
header
("Location: index.php");



I also discovered that when you alter the users Table to add the "sessionid" column, you use:
PHP Code:
 ALTER TABLE `usersADD `sessionidVARCHAR(255NOT NULL

but in the CheckCookie() function sqlQuery it reads:

PHP Code:
 $strQuery mysql_query("SELECT * FROM users WHERE session = '{$_COOKIE['mem']}'"); 


session should become sessionid,

anyway i would appreciates some help with why i get stuck at the marked line above, thanks
__________________
regards,


Fulton

Reply With Quote
  #11  
Old April 6th, 2003, 05:17 PM
Quocain Quocain is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 1 Quocain User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Exclamation DDDooGGG

DDDooGGG there is another error in the code:

you have to add
PHP Code:
global $dtlsSecurity
to the checkcookie function.

The corrected CheckCookie() function:

PHP Code:
function CheckCookie()
{
        global 
$dtlsSecurity;


        
$strQuery mysql_query("SELECT * FROM users WHERE sessionid = '{$_COOKIE['mem']}'");
        if(
$cookie mysql_num_rows($strQuery) > 0)
        {

            
//cookie session = stored session, login
            
$result mysql_fetch_array($strQuery);
            if(
$dtlsSecurity->StoreSession($result[0], $result[1], $result[3], "{$result[4]},{$result[5]}"))
            
header("Location: index.php");
        }
        else
        {

            
//cookie doesnt match any session
            
setcookie("mem","",time()-1);
            
header("Location: index.php");
        }




Excellent article. Too bad the posted code in the support files needs a lot of additional debugging.

Q

Reply With Quote
  #12  
Old April 6th, 2003, 06:47 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Just to note, that I will be writing the final part of this article today, as well as reviewing the previous articles for bugs, ect.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingProgramming Tools > Article Discussion: Building a Members Area With PHP: Part 4/6


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 | 
  
 

Iron Speed




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