updwebmaster Posted December 10, 2007 Share Posted December 10, 2007 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? Quote Link to comment Share on other sites More sharing options...
trq Posted December 10, 2007 Share Posted December 10, 2007 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. Quote Link to comment Share on other sites More sharing options...
updwebmaster Posted December 10, 2007 Author Share Posted December 10, 2007 The only problem is that my webhosting company doesn't support MySql in my subscription.. Is there an alternative? Quote Link to comment Share on other sites More sharing options...
updwebmaster Posted December 10, 2007 Author Share Posted December 10, 2007 I posted earlier about trying to set up a session system on my website the only problem is that my subscription doesn't support MySql. I'm regretting, now, not having MySql on my web service, but is there a way to do sessions without having MySql installed? Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted December 10, 2007 Share Posted December 10, 2007 Sessions are not dependent on mysql. Quote Link to comment Share on other sites More sharing options...
updwebmaster Posted December 10, 2007 Author Share Posted December 10, 2007 The only problem is that when I asked someone about setting up a session with my website, they told me to google it and well the only results that I got involved using a MySql database. If it's not dependent on MySql then what is it dependent on? Quote Link to comment Share on other sites More sharing options...
revraz Posted December 10, 2007 Share Posted December 10, 2007 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. Quote Link to comment Share on other sites More sharing options...
updwebmaster Posted December 10, 2007 Author Share Posted December 10, 2007 ok do you know a script or a place that has a script for a session that doesn't use MySql? Quote Link to comment Share on other sites More sharing options...
revraz Posted December 10, 2007 Share Posted December 10, 2007 I just posted above how to use it. Â After you start the sessions, then you can use $_SESSION variables on any page that you start the session on. Â It doesn't care about mysql. Quote Link to comment Share on other sites More sharing options...
updwebmaster Posted December 10, 2007 Author Share Posted December 10, 2007 ok thanks! Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted December 10, 2007 Share Posted December 10, 2007 Perhaps reading this will help - http://php.net/session_start Quote Link to comment Share on other sites More sharing options...
rarebit Posted December 10, 2007 Share Posted December 10, 2007 Here's some more ref's for ya... http://www.phpfreaks.com/quickcode_cats/26/Sessions.php http://www.tizag.com/phpT/phpsessions.php Quote Link to comment Share on other sites More sharing options...
updwebmaster Posted December 11, 2007 Author Share Posted December 11, 2007 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... Quote Link to comment Share on other sites More sharing options...
trq Posted December 11, 2007 Share Posted December 11, 2007 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. Â Quote Link to comment Share on other sites More sharing options...
revraz Posted December 11, 2007 Share Posted December 11, 2007 If it doesnt support PHP, what are you going to use? Quote Link to comment Share on other sites More sharing options...
updwebmaster Posted December 11, 2007 Author Share Posted December 11, 2007 What exactly do you mean when you say: If it doesnt support PHP, what are you going to use? ? Quote Link to comment Share on other sites More sharing options...
revraz Posted December 11, 2007 Share Posted December 11, 2007 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... Quote Link to comment Share on other sites More sharing options...
updwebmaster Posted December 11, 2007 Author Share Posted December 11, 2007 oh sry about that... I meant MySql. My plan supports php. Quote Link to comment Share on other sites More sharing options...
revraz Posted December 11, 2007 Share Posted December 11, 2007 It would be very difficult to have that functionality without a database. Quote Link to comment Share on other sites More sharing options...
updwebmaster Posted December 11, 2007 Author Share Posted December 11, 2007 what other alternative could I use? I've looked at using cookies, but that doesn't seem to work other than keeping their username typed in. Quote Link to comment Share on other sites More sharing options...
trq Posted December 11, 2007 Share Posted December 11, 2007 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. Quote Link to comment Share on other sites More sharing options...
updwebmaster Posted December 11, 2007 Author Share Posted December 11, 2007 ok well thanks for the help and sorry I seemed to have ignored your posts thorpe. I'm extremely sorry for that. Quote Link to comment Share on other sites More sharing options...
trq Posted December 11, 2007 Share Posted December 11, 2007 I'm sorry we can't really offer a better solution. Quote Link to comment Share on other sites More sharing options...
updwebmaster Posted December 11, 2007 Author Share Posted December 11, 2007 it's alright. I was thinking about upgrading soon anyways... I'll update the topic if I do... Quote Link to comment Share on other sites More sharing options...
revraz Posted December 11, 2007 Share Posted December 11, 2007 Webhosts are so cheap now and include mysql databases, there really is no reason not to get one. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.