icekev Posted January 15, 2011 Share Posted January 15, 2011 Hello. I am currently creating my own website. the whole website has some thing that User can see and thing that guess can't see. Now my question is: Can i use the same database for my website and my forum ? like you click a page, eg: Home, and you are still connected. Then you click the forum (PHPBB) and oyu are still connected on the forum. Thanks for you help Quote Link to comment https://forums.phpfreaks.com/topic/224498-website-user-database/ Share on other sites More sharing options...
nomadsoul Posted January 15, 2011 Share Posted January 15, 2011 With my webhost I can't connect my database to another website if it is another domain or on another sever. If you are scripting with php, the session variable should keep your visitor logged in between pages. here's a link http://www.suite101.com/content/using-a-php-session-a102893 but the phpfreaks always have great tutorials about such things Quote Link to comment https://forums.phpfreaks.com/topic/224498-website-user-database/#findComment-1159704 Share on other sites More sharing options...
icekev Posted January 15, 2011 Author Share Posted January 15, 2011 thank you very much for the post but i looked most of my files on my Forum , which was created by my webhost ( hopefully ) and it seems that this is in everyfile: // Start session management $user->session_begin(); $auth->acl($user->data); So should i just add this to my normal index.php file on my website ? or more code should be added ? Quote Link to comment https://forums.phpfreaks.com/topic/224498-website-user-database/#findComment-1159860 Share on other sites More sharing options...
nomadsoul Posted January 16, 2011 Share Posted January 16, 2011 Did you make your own index.php file? such as a homepage? It should be no problem to use that session code. Just paste it. It should be the first thing in your php tag. Unless things have changed. And You should have no problem using the same database for your website and forums. It depends on what you are trying to do with the data. You should be able to hook into your forums database. You want people to visit your forum then if they move to another page they can still be logged into the forum? Quote Link to comment https://forums.phpfreaks.com/topic/224498-website-user-database/#findComment-1160256 Share on other sites More sharing options...
icekev Posted January 16, 2011 Author Share Posted January 16, 2011 Well, i just want the user to stay connected wherever he go on the website ( forum, homepage, new etc...). But i dont see how this simple code will hook the the db? Don't i have to add like where the db is or somthing ? also for my index.php that i did, is there a way to know if the user is connected, to remove those username/password box and the login button ? Thanks again for you help. Really usefull Quote Link to comment https://forums.phpfreaks.com/topic/224498-website-user-database/#findComment-1160324 Share on other sites More sharing options...
nomadsoul Posted January 17, 2011 Share Posted January 17, 2011 We'd have to look at your code and try to figure out what your are trying to do. Since we're not familiar with your website, it's difficult to know exactly what kind of sql etc you would need. It might be a bit beyond me. Good luck Quote Link to comment https://forums.phpfreaks.com/topic/224498-website-user-database/#findComment-1160534 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.