Jump to content

Session


updwebmaster

Recommended Posts

I'm trying to implement a kind of user system into my website. I'll make all of my pages php files and I'm trying to have a popup box appear on the homepage that says "insert username here" and a checkbox that's labeled "guest", so that when other users are on my site, they can see what other users are on the site. Do any of you know how to do that?

Link to comment
Share on other sites

Thats not at all an easy task. You'll need to look at storing your session data within a database. Google for php custom session handler. Once thats implimented you will have a good starting point to get the rest of the features you require built.

Link to comment
Share on other sites

Dependant on your host allowing you to use sessions.  It has to be enabled in the PHP.INI and set up correctly for the path.

 

Then all you have to do is session_start(); at the top of every page and you have sessions active.

Link to comment
Share on other sites

ok well my plan with my web hosting company doesn't support php and I want to know is there a way to have a windows alert box pop up with a form to enter in their username (no password because there won't be any login required) and on every page that they visit, they'll be able to see what members are on the website? Kind of like PHP freaks has in their forums...

Link to comment
Share on other sites

What I said was, in order to build the functionality you require....

 

so that when other users are on my site, they can see what other users are on the site.

 

It would be easiest to use a custom session handler that stored your sessions within a database. There are alternatives to mysql such as sqlite or if you got real desperate you could try implimenting such functionality using flat files.

 

However, the functionality you require is not easily achieved without a database, and in particular, a solution which stores your session data within said database. For feature rich applications you need a server that supports said features. Its that simple.

 

Link to comment
Share on other sites

This

 

ok well my plan with my web hosting company doesn't support php and I want to know is there a way to have a windows alert box pop up with a form to enter in their username (no password because there won't be any login required) and on every page that they visit, they'll be able to see what members are on the website? Kind of like PHP freaks has in their forums...

Link to comment
Share on other sites

Did you read my reply here?

 

I'll try and explain why this is difficult without a database.

 

Session data relates to an individual client. As it stands, every time a user logs in, a cookie is created on the client machine and another on the server. The cookie on the client is used to relate that client to the information stored within the cookie on the server.

 

In order to gather information relating to all logged in clients together in one repository, it is almost essential to store what would normally be stored within the server side cookie within a server side database.

 

This enables you to easily query the database to find out who is logged in, how many people are logged in, what page they are on etc etc.

 

This functionality is very difficult to do without a database, some would even say it is moderately difficult with the database session handling in place.

 

I'm sorry to say, but unless you upgrade your server package to enable some sort of db, your looking at an uphill battle. That's not to say it can't be done, but its a big job.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.