Page 1 of 1

Creat a members section?

Posted: Sat Jul 03, 2004 5:01 pm
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.

Posted: Sat Jul 03, 2004 5:49 pm
by John Cartwright

hey

Posted: Sat Jul 03, 2004 7:41 pm
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

Posted: Sun Jul 04, 2004 6:52 am
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

Hello

Posted: Sun Jul 04, 2004 9:53 pm
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]

Posted: Mon Jul 05, 2004 9:55 pm
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 =]

hey

Posted: Tue Jul 06, 2004 4:20 pm
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.

Posted: Tue Jul 06, 2004 6:35 pm
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.

hello

Posted: Thu Jul 08, 2004 4:05 pm
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-->