September 19, 200718 yr ok here is my issue, im making a site that needs to have php script replicas of, Myspace, Ebay, autotrader and loads more. now i have all the php scripts for this however each one will require a different login?? is there a way (eg using the same my_sql database) or any way possible to make it so you can use just one login for the whole site?? thanks in advance and please speak easy language as im still picking up webdesign as im going along. James
September 19, 200718 yr Yes, it's possible. You ensure that all the sections use the same user database. The site is under one domain, yes? When you say you have "php script replicas of, Myspace, Ebay, autotrader and loads more", you mean there's various sections of your site? I'm not sure if I quite get what your setup is.
September 19, 200718 yr Author Yes, it's possible. You ensure that all the sections use the same user database. The site is under one domain, yes? When you say you have "php script replicas of, Myspace, Ebay, autotrader and loads more", you mean there's various sections of your site? I'm not sure if I quite get what your setup is. yes sorry, as i said im fairly new to all this and so dont use technical talk lol. but yeh basicly its all on 1 domain, but there are many different sections of the site requiring you to register or logon, but i want 1 single login for all, could i just use the same my_sql database?? or would that just make everything fcuk up?? thanks for the reply James
September 19, 200718 yr If I have read this right you want a one username and password box that every member will use? or the same one to display on each page? something like that The way a common login works is it compares two fields of data (normally username and password), so if you have a mySQL database with everyone's details in, each person will have a unique username (more then likely) and then their password that is stored in the database. When they input the username and their password the script that you use will pull the information from the database...it will look at the username and make sure that the password is the one used with that username. If it is the right one then it lets you log in, if not then it will give you an error saying that its the wrong username/password this might help a bit http://www.plus2net.com/php_tutorial/php_login_script.php
September 19, 200718 yr cookies or session variables will keep a member logged in. EDIT:oops misread the last post
September 19, 200718 yr what you can use is a database something like this: id username passwordhash (remember to md5 passwords - not just store them as plaintext) permissions for the permissions you can then use a CHMOD style numbering: 0 - no perms 1 - ebay 2 - MySpace 4 - Autotrader 8 - Facebook 16 - Bebo to set the perms, say I have "MySpace" and "Facebook", my perm number is 10, and only those two will result in that number. if the CHMOD thing looks too complex, you can just use multiple fields with boolean values.
September 19, 200718 yr Author cookies or session variables will keep a member logged in.EDIT:oops misread the last post ok so i think i get that. so with that theory in mind does this mean that you could use the same my_sql database for each seperate section of a site? Edit - jsut re-read the last post this is a lil over my head now, luckly my mate is a desiner and knows more than i so i shall ask him to read what you have said thanks for the input
September 19, 200718 yr ok so i think i get that. so with that theory in mind does this mean that you could use the same my_sql database for each seperate section of a site? yes
October 3, 200718 yr What you might find you can do is create your own login script (there are loads of tutorials on this) which queries your user database and sets the relevant server variables and cookies. You would have to make sure you remove any login and log out buttons from the scripts you have. I've used this method a few times when a client wanted to log in to a forum and a website from the main page of the site and it does work. It's not the most elegant solution but if you're new to the whole coding thing then it might be your best option.
Create an account or sign in to comment