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:
  #1  
Old January 10th, 2003, 12:08 AM
Vantera Vantera is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Location: South Coast of NSW, Australia
Posts: 108 Vantera User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 17
Send a message via ICQ to Vantera
Article Discussion: Building a Members Area With PHP: Part 5/6

If you have any questions or comments please post them here.

This forum post relates to this article

Reply With Quote
  #2  
Old January 10th, 2003, 05:00 PM
msmetsers msmetsers is offline
Registered User
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
Welcome back!

Hv bn ckg the site daily for the follow up.
Thanks,
Martin

ps I'll be back with my stupid questions lateron.....

Reply With Quote
  #3  
Old January 12th, 2003, 04:37 AM
wareseeker wareseeker is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 71 wareseeker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 7 sec
Reputation Power: 16
Question

Hi!

I would like to ask the author of this article or anyone who are learning from this article a question: Is there any register.php file? or the registration.php file to be instead. Because, in the index.php file it has a link that linked to register.php.

Regards,

Reply With Quote
  #4  
Old January 12th, 2003, 04:41 AM
msmetsers msmetsers is offline
Registered User
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
register

Yep, tts a small typo, change the link to this file into registration
Martin

Reply With Quote
  #5  
Old January 12th, 2003, 04:50 AM
wareseeker wareseeker is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 71 wareseeker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 7 sec
Reputation Power: 16
Thumbs up

Thanks Marty. Have a nice day!

Reply With Quote
  #6  
Old January 12th, 2003, 08:40 PM
kylie kylie is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 19 kylie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Yes, that is a typo.

Reply With Quote
  #7  
Old January 16th, 2003, 11:41 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
registration.php ...

also, depending on the version of php you are using <Ben said that he was using version 4.0> you may need to change the way your variables are passed.. ie, turning register global variables off

Reply With Quote
  #8  
Old January 16th, 2003, 07:51 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
im actually using php 4.2.1

Reply With Quote
  #9  
Old January 20th, 2003, 03:43 AM
motorgnom motorgnom is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 2 motorgnom User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
not logging in on index.php without cookies

hi there everybody!!

playing and struggling around with this tutorials for a time now, im stucked onto a problem i dont find any solution for....

ive got almost everything working fine right now, i get my records into the tables (users, session, log), but if i try to log in on the index.php with switched off cookies, the page shows me the 'welcome guest'-sentence, instead off my first-and lastname...if i try the isLoggedIn-function on this page, after a sucessful login on the login page (with isLoggedIn-function returning = '1' ), i get return of '0'.

anyone had the same probs? or do have any idea to solve this? perhaps master rowe himself?

help would be very appreciated!!
greetz
holger

Reply With Quote
  #10  
Old January 20th, 2003, 04:15 AM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Firstly you need to determine what is actually causing the problem. open up the session table, and check if there are actually entries in the database, and also check if they are valid (echo your session_id() and compair to the db)

from there you should have a better idea where to look

Reply With Quote
  #11  
Old January 20th, 2003, 08:06 AM
motorgnom motorgnom is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 2 motorgnom User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
not logging in on index.php without cookies- 2nd

hi ben,

thanx for fast reply....
well, ive checked the $session_id on the index.php, and it is a different to the id, which is generated on login.php...it seems to me, that the call of the isLoggedIn-function generates everytime a new session_id....

ive tried a lot, but i dont have any clue to get around this...
thanx again,
holger

Reply With Quote
  #12  
Old January 20th, 2003, 04:30 PM
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
Correct me if I'm wrong, Ben, but the session ID shouldn't be different unless they've: A) Logged onto the system from a different computer or B) let their session time expire, right?

Reply With Quote
  #13  
Old January 20th, 2003, 06:03 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Quote:
Correct me if I'm wrong


Ok, im correcting you. While it is not the norm, some server builds do not actually store the session_id from that computer.

This is why you are getting a different id, and its not logging in.

Try the following to fix the problem. Open up ur php.ini file.

look for "session.use_cookies"

make sure its set to 1

look for "session.auto_start"

turn that to 1

restart your server and try again.

Reply With Quote
  #14  
Old January 20th, 2003, 06:06 PM
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
ok thanks

Only reason why I thought that is because with the configuration Im using the session # never changes until it either expires or I log on with another machine...

Thanks for clarifying it for me

Reply With Quote
  #15  
Old January 27th, 2003, 09:07 AM
DeletedUser DeletedUser is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 2 DeletedUser User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
online.php

hi@all

have i to include "online.php" into the site where i want to use the "who-is-online" - function ?
i tried to include it into index.php but when i load the page i get the following:

"Fatal error: Cannot redeclare class dbVars"

what does this mean ? how can i avoid this mistake ?

hope someone can help me.

cu

Reply With Quote
  #16  
Old January 27th, 2003, 08:24 PM
MacZealot MacZealot is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 1 MacZealot User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
one question.

How do I make a log out link? thus ending the session?

I haven't seen a single thing about this anywhere.

Reply With Quote
  #17  
Old January 27th, 2003, 09:22 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
deleteduser,

try using include_once instead of include to fix your problem.

MacZealot,

this is rather easy, all you have to do is make a link to:

login.php?strMethod=logout

I think thats right?!?!?

Reply With Quote
  #18  
Old January 28th, 2003, 01:45 AM
DeletedUser DeletedUser is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 2 DeletedUser User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thumbs up

thanks a lot.

now it works

i really like your article and can't wait to read the last part.

thx.

Last edited by DeletedUser : January 28th, 2003 at 05:54 AM.

Reply With Quote
  #19  
Old January 28th, 2003, 07:15 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
ive been meaningto finish off the last part of the article but there is a little thing called time thats stopping me from doing so.

Hopefully it should be up soon

Reply With Quote
  #20  
Old January 29th, 2003, 05:06 PM
kdoig kdoig is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 1 kdoig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Database session table

Ok, this isn't a huge problem but some what of a concern to me. Is there anyway to let those sessions that are stored in the session table expire so that they are deleted after a certain amount of time?

(So that the session table doesn't get cluttered up when a user neglects to 'log off'...)

Reply With Quote
  #21  
Old February 12th, 2003, 12:37 PM
timepoint5 timepoint5 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: bayern
Posts: 17 timepoint5 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
No chance to get this going with session.auto_start = off?

i thought open session would do the trick but sad sad...

Last edited by timepoint5 : February 12th, 2003 at 12:49 PM.

Reply With Quote
  #22  
Old February 16th, 2003, 04:19 AM
msmetsers msmetsers is offline
Registered User
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
return to original page after login

Is there a way to return to the page you were trying to see which, becuz u were not logged in caused the login screen to appear?

Now it returns to the index.php, I think it would be more friendly to return to the page from which the user came.

Let's assume I tried to see page4.php which is protected and causes the login screen to appear when u're not logged in. After login in you return to index and have to find your way back to page4.php.

Any clues?
Thanks,
Martin

Reply With Quote
  #23  
Old February 16th, 2003, 07:28 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
you can change the header('location: /index.php'); to header('location: /page4.php'); at the end of the "successful login" part of the login code

Reply With Quote
  #24  
Old February 16th, 2003, 07:47 AM
msmetsers msmetsers is offline
Registered User
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
Login redirect

Thanks, unx tt.

But that would mean i'd hv to change > 100 pages or make > 100 login.php's for each page 1.

Isn't there a javascript like go to history-1 or wotever..?

Thanks Martin

Reply With Quote
  #25  
Old February 19th, 2003, 09:59 PM
timburgan timburgan is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 3 timburgan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Arrow MySQL ARTICLES table

I've just been looking at the "PART 5" article.

In Method THREE it says to add an extra field to the ARTILES table using the following:
PHP Code:
 ALTER TABLE `articlesADD `timeexpireTIMESTAMP NOT NULL
The problem: When did we initially create the ARTICLES table?
There is an ARTICLE field in the NEWS table, but I don't think that's what we're talking about.

Can someone please step me through how to create this table, cos I'm fairly new at it.

Is is like this:
PHP Code:
 CREATE TABLE articles (
timeexpire TIMESTAMP NOT NULL
); 
I don't know if there are supposed to be any other fields in the table .. can someone please point me to the article where this TABLE is actually created.

Thanks very much in advance.

Cheers Digger

Reply With Quote
  #26  
Old February 20th, 2003, 06:46 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
THe articles table is in relation to mytches article on creating a multi page article system, that was clearly pointed out several times during the article.

Reply With Quote
  #27  
Old February 25th, 2003, 09:21 PM
monkeon monkeon is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 2 monkeon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi.

Firstly I'd like to thank Ben for the effort he has put into this article series- it's the best one I've found on the net ever! Thanks Ben.

I have it all working perfectly apart from one small problem, which I cant seem to solve. If if click "remember me" on computer (a) and do the same on combuter (b), when I try and visit the page on combuter (a) again- i get an error message saying "The page cannot be displayed."

If i delete the cookies on combuter (a), the page will load normaly though..

Any ideas?

Thanks

//michael.

Reply With Quote
  #28  
Old February 26th, 2003, 01:07 AM
timepoint5 timepoint5 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: bayern
Posts: 17 timepoint5 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
What do you get by echoing the cookie?

Reply With Quote
  #29  
Old February 26th, 2003, 05:41 AM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
When you echo the cookie, you will echo the value of the cookie.

A cookie stores a name/value pair.

As for using cookies for two computers, it won't work. I didnt design for it to work that way.

Reply With Quote
  #30  
Old February 27th, 2003, 09:52 PM
monkeon monkeon is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 2 monkeon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I know that its not supposed to work that way..

It should delete the cookie and say your not logged in when you go back to the original computer, but it says the page cannot be displayed instead. when i delete the cookies it works back on the original computer though.

This means the problem will be in the few lines that detect the cookie or the CheckCookie() method, but i can see nothing wrong.

The values in the cookies are stored correctly.

thanx again.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingProgramming Tools > Article Discussion: Building a Members Area With PHP: Part 5/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