For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > May 2006 > Very basic login Query









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Very basic login Query
KiwiBrian

2006-05-28, 3:57 am

Is there a simple PHP script that can be used in a PHP and Mysql supported
web-site to ask the visitor for a user-name and password, and then give him
access to a restricted set of a few pages appropriate to that particular
user?
Or can anyone point me to an easy tutorial on implementing such a scheme.
Or is this an inapropriate request from someone who knows no PHP?
TIA
Brian Tozer


Geoff Berrow

2006-05-28, 3:57 am

Message-ID: <e5bfcn$crl$1@lust.ihug.co.nz> from KiwiBrian contained the
following:

>Is there a simple PHP script that can be used in a PHP and Mysql supported
>web-site to ask the visitor for a user-name and password, and then give him
>access to a restricted set of a few pages appropriate to that particular
>user?
>Or can anyone point me to an easy tutorial on implementing such a scheme.
>Or is this an inapropriate request from someone who knows no PHP?


Google shows a good selection but I don't know how easy they are to
implement.
http://www.google.co.uk/search?q=pr...pages+php+mysql
--
Geoff Berrow 0110001001101100010000000110
0011011010110110010001101111011001110010
11
1001100011011011110010111001110101011010
11
PHILIP Milbanke

2006-05-31, 7:00 pm

A guy who refers to himself as jpmaster77 wrote a really good one. The link
below has all the info you need, the download link for the .php pages & .sql
files, as well as a good section of Q&As.

http://www.evolt.org/article/PHP_Lo...atures/17/60384

The code to restrict access to certain pages is part of the main.php file,
but if you close the php code it saves all the 'echo' commands and you can
use pure html until/unless you actually need php again.

ie:

<?
if($session->logged_in){
?>
HTML code for registered users
<?
}else{
?>
Alternative HTML code for unregistered visitors (eg, login form or a
redirect to another page)
}
?>

"KiwiBrian" <briantoz@ihug.co.nz> wrote in message
news:e5bfcn$crl$1@lust.ihug.co.nz...
> Is there a simple PHP script that can be used in a PHP and Mysql supported
> web-site to ask the visitor for a user-name and password, and then give
> him access to a restricted set of a few pages appropriate to that
> particular user?
> Or can anyone point me to an easy tutorial on implementing such a scheme.
> Or is this an inapropriate request from someone who knows no PHP?
> TIA
> Brian Tozer
>



Rik

2006-05-31, 7:00 pm

PHILIP Milbanke wrote:
> A guy who refers to himself as jpmaster77 wrote a really good one.
> The link below has all the info you need, the download link for the
> .php pages & .sql files, as well as a good section of Q&As.
>
> http://www.evolt.org/article/PHP_Lo...atures/17/60384
>
> The code to restrict access to certain pages is part of the main.php
> file, but if you close the php code it saves all the 'echo' commands
> and you can use pure html until/unless you actually need php again.


I must say, I'm not working that long with PHP, and looking through the code
of jpmaster77 really helped in organizing a login system about 6 months ago,
compared to others hits I found back then. Clear code, which doens't
necesseraly need to be copied, but will give you a lot of clues.

Grtz,

Rik


KiwiBrian

2006-05-31, 9:57 pm

Thanks chaps.
Brian.

"Rik" <luiheidsgoeroe@hotmail.com> wrote in message
news:ead40$447e3568$8259c69c$8928@news1.tudelft.nl...
> PHILIP Milbanke wrote:
>
> I must say, I'm not working that long with PHP, and looking through the
> code
> of jpmaster77 really helped in organizing a login system about 6 months
> ago,
> compared to others hits I found back then. Clear code, which doens't
> necesseraly need to be copied, but will give you a lot of clues.
>
> Grtz,
>
> Rik
>
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com