user logins

E

entity512

Guest
I am trying to help my girlfriend with a web project. She has some kind of community thing going on. I was wondering how would i go about setting up a login page that can go to a place to make up a profile for a user, and they can edit it and such and such. I ahve SQL/PHP
 
I have a script at home that I'll post here when I get in from work,
username and passwords are stored in a database, the PHP script uses a simple
select privellage from users where username = "$username" and password = "$pass"
(I wanted to be able to log users on with different privellages.
Then the PHP creates two session variables, the first is a flag to say that the user is actually logged in, the second is a flag containing the privellage of the user.
If the user tries to view a page they are not entittled to see without being logged in then they are taken to the log in page.
(it's a simple if statement).
 
yer...but this is mainly just so they can edit their own page. In HTML or whatever it may be.
 
OK, in that case what you will be doing is storing their pages inside of their home directories.

their home pages will be static HTML files.

You will need to use the fopen function of PHP to open the file and store it to a variable.

then you dump the contents of the variable into a text area

print "<textarea>$filecont</textarea>";

then once they are done you just store the file again. You don't really need to use the database for anyting but the login. There are functions in PHP that enable you to browse through directories and return files,
I'd suggest however if you wanted it to be really cool (or what I though was cool when I did something like this) is to store filenames and paths in a database so you can make a nice treeview without having to worry about the propery controls, (if they are even available in PHP).

(if you don't get what I just said about the tree view check out here It's a part of my final year project from Uni, there was a login function as well, but I too that off
 
Back
Top Bottom