Creat a members section?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
zousug
Forum Newbie
Posts: 6
Joined: Sat Jul 03, 2004 5:01 pm

Creat a members section?

Post by zousug »

hello,

im new to php and cant find what im looking for anywhere so im goign to ask if there is some one here that can tell me how or show me where a tutorial is so i can make my own..

what i am after..

1) php and mysql db members login

2) registration page - with a email validation

3) 3 user levels
(lvl 1 - Admin
lvl 2 - moderator
lvl 3 - User)

4) users can edit there details (I.e username password email address ect)

i think that was it.. (midnight and im half asleep)

if any one can help me it would be great thanx a lot.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

zousug
Forum Newbie
Posts: 6
Joined: Sat Jul 03, 2004 5:01 pm

hey

Post by zousug »

Hello..

Thanx Phenom.. im looking at the site now and i think i found 1 or 2 that will do for what im after..

THANX :D
User avatar
tim
DevNet Resident
Posts: 1165
Joined: Thu Feb 12, 2004 7:19 pm
Location: ohio

Post by tim »

if you wish to learn php n MySQL, there are a slew of excellent tutorials, you could code what you described in 30 minutes.

FYI
zousug
Forum Newbie
Posts: 6
Joined: Sat Jul 03, 2004 5:01 pm

Hello

Post by zousug »

Hey.

cool, could you tell me where i could find the tutorials pls tim??

i would love to learn how to make one my self :D

i have a question..

i have a login script from the site that phenom told me about.

my main page (not a .php page though im thinking of changeing it) has a fourm in a table with a login setup..

is there away i can change that to the one from the login script (so that the members enter there name and stuff there and when they login correctly it changes to say Welcome (username))

here is the login code from the script

Code: Select all

<?php

$login_real_path = "./";
include($login_real_path . "common.php");

include($login_real_path . 'includes/page_header.php');
$template->getFile(array(
                   'login' => 'login.tpl')
);
$template->addVar("login", array(
                   )
);
$template->parse("login");
include($login_real_path . 'includes/page_footer.php');

?>
any ideas?? thank you.


<--EDIT-->
Hey, if you want to look at the layout for the site im makeing you can goto http://www.lsotfe.net and have a look.

the code for the current login fourm on the site is here

Code: Select all

&lt;form mode="post" action=""&gt;&lt;/br&gt;
&lt;font class="block-content"&gt;Username&lt;/font&gt;&lt;/br&gt;
&lt;input type="text" name="username" size="15"&gt;&lt;/br&gt;
&lt;font class="block-content"&gt;Password&lt;/font&gt;&lt;/br&gt;
&lt;input type="password" name="password" size="15"&gt;&lt;/br&gt;
&lt;input type="submit" name="submit" value="Login"&gt;
&lt;/form&gt;

feyd | Please use

Code: Select all

and

Code: Select all

tags when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
Last edited by zousug on Tue Jul 06, 2004 4:16 pm, edited 1 time in total.
User avatar
tim
DevNet Resident
Posts: 1165
Joined: Thu Feb 12, 2004 7:19 pm
Location: ohio

Post by tim »

well, i'm not going to teach you about sessions, BUT sessions would be the ticket for you.

you may apply cookies as well, or a combo of sessions and cookies

see at php.net the setcookie() function

also, google for MySQL/PHP tutorials, you'll find as many as your heart can desire.

come back with questions =]
zousug
Forum Newbie
Posts: 6
Joined: Sat Jul 03, 2004 5:01 pm

hey

Post by zousug »

hello,

thanx im doing that now (as i type :D) but what im after is how to put the php login code into html so he login fourm i have will work and change to show some other information after the user has logged in.

or would i be better off change my whole site into PHP and have it done that way instead?? :D

thanx.
User avatar
tim
DevNet Resident
Posts: 1165
Joined: Thu Feb 12, 2004 7:19 pm
Location: ohio

Post by tim »

hmm

just use the $_POST or $_GET method (however you transfer the form variables)

if you are unaware of what i'm talking about, I think theres a tutorials "how to transfer vars w/ $_POST/$_GET in the Wiki section.
zousug
Forum Newbie
Posts: 6
Joined: Sat Jul 03, 2004 5:01 pm

hello

Post by zousug »

hey,

thank for all ur help..

im now useing this code here and it seems to be working fine.

Code: Select all

<form method="post" action="check.php"></br>
<font class="block-content">Username:</font></br>
<input type="text" name="username" id="username" size="15"></br>
<font class="block-content">Password:</font></br>
<input type="password" name="password" id="password" size="15"></br></br>
<input class="mainoption" type="submit" name="submit" value="Login"></br>
<!--<a href="register.php">Register</a>&nbsp;--><a href="login/forgot.php">Forgot Password</a>
</form>
thank you for all your help.


<--EDIT-->
one thing that i cant work out.. and just found out lol..

this code here

Code: Select all

<form method="post" action="check.php"></br>
makes it check that php file but the file is in a different directory..

if i chaneg the code to be like this.

Code: Select all

<form method="post" action="login/check.php"></br>
it dose not make it work. (I.e it keeps looking in the dir were my main.html file is located.)

is there away i can change this?

thanx
<--END EDIT-->
Post Reply