View Full Version : How to: show users on the page they are
Hi,
I've made a script where guests can put in there name and a message. All guests can do this and all guests currently online on the page can read it.
Now I've added a second page, but this shows all the users and their messages even from page 1. I want it so that all the guests on page one see all the messages and guestnames on page one. The guests on page 2 will only see the guest names and messages on page 2 etc
And if possible, the menu will show how many guests are currently on the page.
I have a demo here (http://www.sourceskins.com/test/) (don't mind the looks it's just a demo).
Other issues:
If I refresh the page after 30 min or so, I have to re-fill in my message and name. Why is this, I mean, I am still on the page, never left it, so my info shouldn't be deleted. (It's supposed to delete a guest from the db when he leaves the page).
Also, I just started learning php so if there is some code clean up etc plz do :)
Hope you guys can help me fix these things
Null
ps In the attachment are all the files you need
It's supposed to delete a guest from the db when he leaves the pageNo, it's supposed to delete a guest from the database when s/he enters another page in which a user object is used. There's quite a big difference.
If I refresh the page after 30 min or so, I have to re-fill in my message and name.Well, you've done it by IP, so I can only conclude that your IP must be changing. Do you use a dial-up connection?
I want it so that all the guests on page one see all the messages and guestnames on page one.Then you want to keep track of the page the user is on in that database too.
Also, I just started learning php so if there is some code clean up etc plz doIt's actually quite good, especially for a beginner. You've even used objects. In fact, you've even used objects properly, which is a lot rarer to see :)
"Well, you've done it by IP, so I can only conclude that your IP must be changing. Do you use a dial-up connection?"
No I have cable. I also used ip instead of sessions cause peeps told me it was more accurate...
"It's actually quite good, especially for a beginner. You've even used objects. In fact, you've even used objects properly, which is a lot rarer to see"
Thx had some help though ;)
"Then you want to keep track of the page the user is on in that database too."
Owkee and how to do that? Cause if I have that, I think I can fix the menu myself
Owkee and how to do that?The same way you stored the user's IP, name, avatar and timestamp to the database. :) You can access the name of the current page with $PHP_SELF.
The same way you stored the user's IP, name, avatar and timestamp to the database. :) You can access the name of the current page with $PHP_SELF.
Could you do this for me? And add some comments in the script? This way I can see what and how you've changed it and learn from it. I cannot seem to get it done right myself :mad:
Thx
mwinter
04-07-2006, 02:21 PM
Well, you've done it by IP, so I can only conclude that your IP must be changing. Do you use a dial-up connection?No I have cable. I also used ip instead of sessions cause peeps told me it was more accurate...Presumably you're both discussing identifying users by IP address. That's a bad idea, and one only needs to consider AOL to see why.
The AOL browser (based on IE) usually routes requests through load-balanced proxy servers run by AOL. These caches are shared by thousands of people (possibly more). Not only will these people appear to have the same IP address, but as the proxies are load-balanced, a single user could appear to have multiple IP addresses for the same batch of requests.
AOL is an extreme case (though at over 20 million users, an influential one), but not the only such scenario. Other users can and do use caches provided by their server provider, and other ISPs also rely on NAT, similar to AOL.
Mike
Could you do this for me? And add some comments in the script? This way I can see what and how you've changed it and learn from it. I cannot seem to get it done right myself :mad:
Thx
Darn it wont work, some help? Excample?
Null
What've you got? Post it and I'll have a look. In [code] tags would be nice.
What've you got? Post it and I'll have a look. In [code] tags would be nice.
See zip at first post, got so frusterated I deleted my not working addings :(
kalabok
04-12-2006, 03:39 PM
i was looking for a free date picker in the internet for my web-site that is still in a development stage. i found one on http://www.kodart.com.
i find it as a well done thing, but i would like to add some features. and since i know nothing about software development i would really appreciate some help to custumize the picker (i.e. add pop-up notes to dates, change navigation and size and so on).
i'm sorry i couldn't get source code from the software, but i think you can see on the developers site (http://kodart.com/getfree.php)
thank in advace :)
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.