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:
  #31  
Old November 28th, 2002, 07:12 PM
nosta nosta is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Posts: 9 nosta User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Great Thx

Reply With Quote
  #32  
Old November 28th, 2002, 09:30 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Ive got no idea why it happened either?

Reply With Quote
  #33  
Old November 29th, 2002, 01:53 PM
nosta nosta is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Posts: 9 nosta User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
ah ...

hi again ! until now i could fix some problems. i can login, the data stored in the tables is correct now so everything works fine.

the problem is :
when i log in, i got the confirmation i'm logged in but when i visit 'index.php' i still am considered as a guest.

i'm lost any ideas ? i'dreally appreciate, thanks a lot !

Mike

Last edited by nosta : November 29th, 2002 at 02:03 PM.

Reply With Quote
  #34  
Old November 29th, 2002, 05:19 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Mike,

This is due to your server and not the script this time.

The reason why this is happening is because your sessions arnt working correctly? are you using IIS?


Theres an option in the php.ini file to auto start session ids, you will need to turn this on, as its the only solution i know of to fix the problem

Reply With Quote
  #35  
Old November 29th, 2002, 07:38 PM
nosta nosta is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Posts: 9 nosta User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks for replying.

I think i got a session id added to the url when i used the code in the article and not the one in the support file, not sure ... i'll have a look at it and let you know ...

got this kinda links in my IE history :
/index.php?PHPSESSID=5d11961bcab266a3e93d2e26489c2d c7



I got phpShop running and it processes sessions the same way right ? (guess)

I'll be back later when I fixed it



(not using IIS)

Last edited by nosta : November 29th, 2002 at 08:11 PM.

Reply With Quote
  #36  
Old November 29th, 2002, 08:30 PM
nosta nosta is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Posts: 9 nosta User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Could anyone send me a working login.php page please ? Or post it

ah i need a break, getting nervous here

Reply With Quote
  #37  
Old December 7th, 2002, 03:11 PM
AmericanD AmericanD is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Posts: 81 AmericanD User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 16
there is a problem

when i try to login it logs me in but when i go to index.php specified in article 2/6 , it still asks me to register


maybe the server is not supporting sessions/cookies, so how do i go about doing it ?
__________________
Hungry for Code

Programming works best with a team over one single person

Last edited by AmericanD : December 7th, 2002 at 03:19 PM.

Reply With Quote
  #38  
Old December 7th, 2002, 03:17 PM
AmericanD AmericanD is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Posts: 81 AmericanD User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 16
even so that when i login , it says 'you have logged in' and when i refresh that same login.php page after logging in, it logs me out .. hmm

Reply With Quote
  #39  
Old December 7th, 2002, 11:03 PM
AmericanD AmericanD is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Posts: 81 AmericanD User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 16
one more question.

when we create users table, we say `users` and when we create sessions table, we just say sessions. why is that ?

Reply With Quote
  #40  
Old December 8th, 2002, 12:14 AM
AmericanD AmericanD is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Posts: 81 AmericanD User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 16
ok my scripts started working now.. its just that table names weren't specified........ and it wasn't even mentioned in the article !!!

Reply With Quote
  #41  
Old December 8th, 2002, 04:20 PM
Dart Dart is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Posts: 4 Dart User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
hi all

thanks for the aouther of this article

i've just finished coding a class with the same idea

i so this class

it's good

but i think there is a problem in login.php

in line ( about 106 or nearby )

you used mysql_fetch_row

while you should use mysql_fetch_array

that's why the session where recorded to the database with

out the info of ( username , userid , auth , firstname , lastname )



thanks to you at all


Reply With Quote
  #42  
Old December 8th, 2002, 08:36 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
AmericanD, wernt the field names the default names specified in the security function?? if there not please let me know, and im very sorry to all who got confused by this,

im only human, (i think)

Reply With Quote
  #43  
Old December 9th, 2002, 10:35 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
OK OK OK, well ive finally opened a thread regarding the issues with my article, if you find a bug in my code (please make sure you havent made the mistake) please post the problem and where it is wrong in the article here: URL

Once i get a chance i will fix up the article,

Reply With Quote
  #44  
Old December 9th, 2002, 11:07 PM
AmericanD AmericanD is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Posts: 81 AmericanD User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 16
Quote:
Originally posted by Ben Rowe
AmericanD, wernt the field names the default names specified in the security function?? if there not please let me know, and im very sorry to all who got confused by this,

im only human, (i think)


Lemme tell u what was wrong.

In the first article 1/6 the code did not have proper table names in class security file. the select statements couldn't write into the session table anything BUT the sessionid. so thats the only problem

but in your 2/6 article where you showed how to make tables, you had the other login page which was perfect since you had referenced the tables in it.

i just copied and pasted but since you advised me to read the support material and do it, i learnt a lot.. so it was good for me .. no copying pasting in the future blindly

Reply With Quote
  #45  
Old December 10th, 2002, 07:12 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Ahh thankyou, ill make these changes once ive put up the next article.

Reply With Quote
  #46  
Old December 10th, 2002, 11:07 PM
AmericanD AmericanD is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Posts: 81 AmericanD User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 16
and the logout button

Reply With Quote
  #47  
Old December 18th, 2002, 09:27 PM
mrl14 mrl14 is offline
1 Month Free Hosting!
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 15 mrl14 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Exclamation typos

It seems many of the errors people are running into are types. I found one as well.

if($result)
{

// Write to the log file
$strLog = "Login OK: {$result[1]}, {$result[3]}, {$result[4]}, {$_SERVER['REMOTE_ADDR']}, " . date("d/m/Y h:i:m A");
$dtlsSecurity->AddLog($strLog);

if($dtlsSecurity->StoreSession($result[‘userId ‘], $result[‘username’], $result[‘level’], "{$result[‘firstname’]},{$result[‘lastname’]}"))
{

that code is unmodified. The problem resides here:

if($dtlsSecurity->StoreSession($result[‘userId ‘],

it should be

if($dtlsSecurity->StoreSession($result[‘userId’],

As you can see there was a space and the wrong single quote was placed there. Why not stick to basic quotes instead of curly quotes?

Anyways that fixes one of serveral issues I had and I will post those later tonite since I gotta go out right now.

Anyhow great article, this is just what I needed to add to my site =)


Edit:

oh yeah one more thing, I got confused when I got to what I believe was login.php page. The article never states what to call this page and I didn't know if it was to go on the registration.php page or on a new page...after some thinking i decided to call it login.php...hope I was right =)

Edit 2:

Why is the login page and registration pages NOT included in the support files? copying and pasting code just increases our change of errors. My editor supports regular quotes and curly quotes (using BBEdit) and that sometimes is messing up the code when I copy it. Not to mention you reiterate code to explain (which is great) but it's in the same colour yellow, thus confusing the readers that it needs to be included in the page.

Last edited by mrl14 : December 19th, 2002 at 07:40 PM.

Reply With Quote
  #48  
Old December 20th, 2002, 08:46 AM
VLE79E VLE79E is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 1 VLE79E User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
The Registration.php does not work. When I Press Join nothing happens, the same registration page comes on again. I tried to add this line to the registration page but no output. Anyway?

echo $_POST['what'];

Reply With Quote
  #49  
Old December 20th, 2002, 10:41 AM
mrl14 mrl14 is offline
1 Month Free Hosting!
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 15 mrl14 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
yep...same here...after one successful registration I can no longer register accounts. I get the INSERT statement but no statement about passwords, same accounts or successful.

Looks like this script needs to be tested a little bit more.

Last edited by mrl14 : February 3rd, 2003 at 05:35 PM.

Reply With Quote
  #50  
Old February 3rd, 2003, 11:39 AM
StuRReaL StuRReaL is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 3 StuRReaL User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
This class is all very well and good and it is good don't get me wrong, but i can see a floor, your assuming with this database logging that a user will always choose logout, otherwise your going to get a huge number of sessions logged in the database if the users didn't click logout.

I guess this is a time where PHP not having a destructor causes it to fall down :S

Or have i just not fully understood and it does delete session logs

Last edited by StuRReaL : February 3rd, 2003 at 11:42 AM.

Reply With Quote
  #51  
Old February 3rd, 2003, 06:32 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
just run a cron, This is something i could not show because windows doesnt use crons

Reply With Quote
  #52  
Old February 4th, 2003, 03:02 AM
StuRReaL StuRReaL is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 3 StuRReaL User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
whats a cron? and how does it work?

Reply With Quote
  #53  
Old February 10th, 2003, 06:09 AM
pjp pjp is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 10 pjp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
i used the code from the article for part 2 and the support material for part one. the reason fro this is because i could'nt find any support material for the registration and login scripts.

what happens is that when i attempt to log in i simple get a bank page that says
Database Error:
Go Back

when i select * from the log table i see that the following error has been input into the table
error:

Database Server error, Login, encrypted password, ip address, date, & time

i understand that this piece of code is responsible for the error

$strLog = "Database Server Error: Login, $strUser, $strPass, {$_SERVER['REMOTE_ADDR']}," .
mysql_error() . "," . date("d/m/Y h:i:m A");
$dtlsSecurity->AddLog($strLog);

When i select * from user table it showns that tere is nothing in it.


if anyone wishes to see all my code then i will gladly send it on to you,and maybe you can find the problem.

Last edited by pjp : February 27th, 2003 at 05:58 AM.

Reply With Quote
  #54  
Old February 14th, 2003, 08:56 AM
bedtymetales bedtymetales is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 2 bedtymetales User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Parse error

Hi! I'm getting a parse error on line 143 of the code for the login.php page.

This is the error:

Parse error: parse error in /home/littlefo/public_html/login.php on line 143

I am totally new to PHP and am not familiar enough with it to know what is causing this error. Any help would be appreciated.




Last edited by bedtymetales : February 14th, 2003 at 09:06 AM.

Reply With Quote
  #55  
Old February 14th, 2003, 09:24 AM
bedtymetales bedtymetales is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 2 bedtymetales User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Parse error

I figured it out all on my own!

"{$result['firstname']},{$result['lastname']}";

There was a semi colon missing at the end of line 142.

Reply With Quote
  #56  
Old February 21st, 2003, 09:55 AM
rgesse rgesse is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 2 rgesse User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question

Ben...great article...used the meat and potatoes of your code to create an authentication system for my companies intranet ;-)
I do have one question though....what is the benefit of using a session table as opposed to just storing all the data in session variables. Seems tedious(and slower) to have to touch a DB for user data every time you want to get their information when you could just reference the session vars.

Reply With Quote
  #57  
Old February 24th, 2003, 08:56 AM
alex_baciu alex_baciu is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Bucharest
Posts: 3 alex_baciu User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
About "logout" functions!

Can you give an example about how to use the "logout" functions?
I want to have somethink like this:
1. a logout anchor
2. and when a "header(Location: 'login.php')".

Reply With Quote
  #58  
Old February 27th, 2003, 05:53 AM
pjp pjp is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 10 pjp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
heeeeeelllllllllllppppppppp

come on can anyone help or is it that nobody looks at this forum any more

Reply With Quote
  #59  
Old February 27th, 2003, 08:18 AM
nicat23's Avatar
nicat23 nicat23 is offline
Addicted to Chaos..
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jan 2003
Location: Ft. Worth, TX
Posts: 650 nicat23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 48 m 34 sec
Reputation Power: 0
Send a message via AIM to nicat23 Send a message via Yahoo to nicat23
pjp:

I'm not sure what exactly is going on, but do you have your database setup correctly? try this to make sure
log into mysql and do this from the mysql> prompt:
Code:
use <whatever-the-name-of-your-database-is>;
then type:
show tables;
that'll list what tables you have available to choose from.. next type

select * from users;

and that should list every user in your db.. if you don't have any, then you may have a problem with your registration page, because it's not adding to the correct db..

alex_baciu:

I'm not sure what you want to do exactly, as I dont know what a "Logout anchor" is

You could always add a hyperlink to the top of your page.. or do a meta refresh, for say half an hour where if they are inactive it automatically runs the logout script...

Last edited by nicat23 : February 27th, 2003 at 08:21 AM.

Reply With Quote
  #60  
Old March 4th, 2003, 05:46 PM
VisionBel VisionBel is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 5 VisionBel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I have this weird error, well I don't even get an error :

$strQuery = "INSERT INTO users (";
$strQuery .= "username, password, level, rank_r, rank_t, rank_s, rank_c) VALUES (";
echo $strQuery .= "'{$_POST['strUserName']}', '$password', '1', '{$_POST['strRankR']}', '{$_POST['strRankT']} , '{$_POST['strRankS']}, '{$_POST['strRankC']}')";

that's my code

And this is what I see after I press the join button ;

INSERT INTO users (username, password, level, rank_r, rank_t, rank_s, rank_c) VALUES ('fghjfg', '1b2b4c6643b5c96a07abdf16fb2220fe', '1', 'fghj', 'fhgj , 'fghj, 'fghj')


So it doesn't submit it to my database or anything, just echoes it, while the code is exactly the same as yours, just added some stuff ...

HELP !

Reply With Quote
Reply

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


Developer Shed Advertisers and Affiliates


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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap