Go Back   Computer Forums > Web Design | Website Development > Web Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 07-19-2004, 06:43 PM   #1
entity512
Guest
 
Posts: n/a
Default user logins

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
  Reply With Quote
Old 07-20-2004, 06:59 AM   #2
Site Team
 
root's Avatar
 
Join Date: Mar 2004
Posts: 8,007
Default Re: user logins

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).
__________________

root is offline   Reply With Quote
Old 07-20-2004, 09:24 AM   #3
entity512
Guest
 
Posts: n/a
Default Re: user logins

yer...but this is mainly just so they can edit their own page. In HTML or whatever it may be.
  Reply With Quote
Old 07-20-2004, 10:13 AM   #4
Site Team
 
root's Avatar
 
Join Date: Mar 2004
Posts: 8,007
Default Re: user logins

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
root is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 10:14 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0