For Programmers: Free Programming Magazines  


Home > Archive > PHP Programming > January 2007 > How to build a site with access privieges?









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 How to build a site with access privieges?
Dave

2007-01-26, 6:59 pm

Hi all,
I want to build a site which will allow me to restrict a users access
based on assigned privileges and render pages with user-specific
information.

Some other features I would like to have are...

i. to log failed access attempts.
ii. to make information(text) on certain pages easily editable by a 1
group of 'non-technical' users.
iii. a database system for storing data gathered from forms.

I have a basic understanding of html/javascript, and would appreciate
any advice on where to concentrate my education to achieve the results
above.
My first guess would be PHP/MySQL which is why I'm posting here?
Are there any ready-rolled solutions available that could be adapted?
I'm going to setup an apache webserver this wend and experiment a
little, but I don't want to have to re-invent the wheel... ;)

Any pointers most appreciated,

Dave.
mvandenb@gmail.com

2007-01-26, 6:59 pm

Um... people like you scare us. You sound like you have little
experience making web pages, little experience programing or if you do
it is something like vb and no mater what you say you really do not
know what you are talking about.

But I could be wrong, i am often, and this could just for fun. Then I
would recommend this book: PHP and MySQL Web Development
http://amazon.com/s/ref=sr_pg_3/102...Ck%3Aphp&page=3

That book will work and covers most of what you are looking for and
would be an excellent start if A) you know how to program and B) you
know and have experience how to build a database

If ether of those two are a no then um....
I can't help you and should start with one of the learn in 24 hour
books and talk to someone who has done this.

Good Luck
Matthew

Paul Lautman

2007-01-26, 6:59 pm

Dave wrote:
> Hi all,
> I want to build a site which will allow me to restrict a users access
> based on assigned privileges and render pages with user-specific
> information.
>
> Some other features I would like to have are...
>
> i. to log failed access attempts.
> ii. to make information(text) on certain pages easily editable by a 1
> group of 'non-technical' users.
> iii. a database system for storing data gathered from forms.
>
> I have a basic understanding of html/javascript, and would appreciate
> any advice on where to concentrate my education to achieve the results
> above.
> My first guess would be PHP/MySQL which is why I'm posting here?
> Are there any ready-rolled solutions available that could be adapted?
> I'm going to setup an apache webserver this wend and experiment a
> little, but I don't want to have to re-invent the wheel... ;)
>
> Any pointers most appreciated,
>
> Dave.


Try installing Joomla and a couple of its components


Rik

2007-01-26, 6:59 pm

Dave <daveNOSPACEmatthewsA@Tbigfoot_DoT_.com> wrote:

> Hi all,
> I want to build a site which will allow me to restrict a users access
> based on assigned privileges and render pages with user-specific
> information.
>
> Some other features I would like to have are...
>
> i. to log failed access attempts.
> ii. to make information(text) on certain pages easily editable by a 1
> group of 'non-technical' users.
> iii. a database system for storing data gathered from forms.
>
> I have a basic understanding of html/javascript, and would appreciate
> any advice on where to concentrate my education to achieve the results
> above.
> My first guess would be PHP/MySQL which is why I'm posting here?


PHP & MySQL have the advantage of being free and having a large following,
so there are plenty people to ask questions. You're free to choose from a
lot of different server-side languages and databases though.

> Are there any ready-rolled solutions available that could be adapted?


Probably, I don't use ready-rolled solutions. A problem that comes with
PHP being an 'easy' language is there are numerous examples out there that
seem to work but are actually quite Bad.

> I'm going to setup an apache webserver this wend and experiment a
> little, but I don't want to have to re-invent the wheel... ;)


Well, to give you some pointers to get started:
- If you're using Windows, use XAMPP for your setup. It will save you a
lot of headache, precise configuration issues you can deal with later when
you know a little bit more, for now it's standard settings will usually
suffice.
- Start learning PHP here: http://www.php.net/tut.php
- Refer to http://www.php.net often. Especially look at the user
contributed notes that accompany most of the functions, they will help
your understanding a lot.
--
Rik Wasmus
Bosconian

2007-01-26, 9:58 pm

"Dave" <daveNOSPACEmatthewsA@Tbigfoot_DoT_.com> wrote in message
news:fYruh.53373$v4.17914@newsfe3-win.ntli.net...
> Hi all,
> I want to build a site which will allow me to restrict a users access
> based on assigned privileges and render pages with user-specific
> information.
>
> Some other features I would like to have are...
>
> i. to log failed access attempts.
> ii. to make information(text) on certain pages easily editable by a 1
> group of 'non-technical' users.
> iii. a database system for storing data gathered from forms.
>
> I have a basic understanding of html/javascript, and would appreciate any
> advice on where to concentrate my education to achieve the results above.
> My first guess would be PHP/MySQL which is why I'm posting here?
> Are there any ready-rolled solutions available that could be adapted?
> I'm going to setup an apache webserver this wend and experiment a
> little, but I don't want to have to re-invent the wheel... ;)
>
> Any pointers most appreciated,
>
> Dave.


What you're asking is not a trival thing and if you're just beginning to
learn server side programming that's quite a lot to bite off.


Benjamin

2007-01-26, 9:58 pm



On Jan 26, 12:42 pm, Dave <daveNOSPACEmatthewsA@Tbigfoot_DoT_.com>
wrote:
> Hi all,
> I want to build a site which will allow me to restrict a users access
> based on assigned privileges and render pages with user-specific
> information.
>
> Some other features I would like to have are...
>
> i. to log failed access attempts.
> ii. to make information(text) on certain pages easily editable by a 1
> group of 'non-technical' users.

You might want to look at the MediaWiki program. It uses PHP and MySQL
to create articles. It's what <a
href="http://wikipedia.org/">Wikipedia</a> runs on. You can find it at
http://www.mediawiki.org.
> iii. a database system for storing data gathered from forms.
>
> I have a basic understanding of html/javascript, and would appreciate
> any advice on where to concentrate my education to achieve the results
> above.
> My first guess would be PHP/MySQL which is why I'm posting here?
> Are there any ready-rolled solutions available that could be adapted?
> I'm going to setup an apache webserver this wend and experiment a
> little, but I don't want to have to re-invent the wheel... ;)
>
> Any pointers most appreciated,
>
> Dave.


Dave

2007-01-27, 7:58 am

mvandenb@gmail.com wrote:
> Um... people like you scare us. You sound like you have little
> experience making web pages, little experience programing or if you do
> it is something like vb and no mater what you say you really do not
> know what you are talking about.
>
> But I could be wrong, i am often, and this could just for fun. Then I
> would recommend this book: PHP and MySQL Web Development
> http://amazon.com/s/ref=sr_pg_3/102...Ck%3Aphp&page=3
>
> That book will work and covers most of what you are looking for and
> would be an excellent start if A) you know how to program and B) you
> know and have experience how to build a database
>
> If ether of those two are a no then um....
> I can't help you and should start with one of the learn in 24 hour
> books and talk to someone who has done this.
>
> Good Luck
> Matthew
>



Hehe...be afraid....!!
I understand your concern, and I am aware of the complexities and
realise this is no small task.
Thanks for the link, I will check it out.

Cheers,

Dave.
Dave

2007-01-27, 7:58 am

Rik wrote:

> PHP & MySQL have the advantage of being free and having a large
> following, so there are plenty people to ask questions. You're free to
> choose from a lot of different server-side languages and databases though.
>
>
> Probably, I don't use ready-rolled solutions. A problem that comes with
> PHP being an 'easy' language is there are numerous examples out there
> that seem to work but are actually quite Bad.
>
>
> Well, to give you some pointers to get started:
> - If you're using Windows, use XAMPP for your setup. It will save you a
> lot of headache, precise configuration issues you can deal with later
> when you know a little bit more, for now it's standard settings will
> usually suffice.
> - Start learning PHP here: http://www.php.net/tut.php
> - Refer to http://www.php.net often. Especially look at the user
> contributed notes that accompany most of the functions, they will help
> your understanding a lot.
> --Rik Wasmus


Thanks Rik, looks like a great site.

Cheers,

Dave.
Carl Pearson

2007-01-27, 7:58 am

Dave wrote:
> Hi all,
> I want to build a site which will allow me to restrict a users access
> based on assigned privileges and render pages with user-specific
> information.
>
> Some other features I would like to have are...
>
> i. to log failed access attempts.
> ii. to make information(text) on certain pages easily editable by a 1
> group of 'non-technical' users.
> iii. a database system for storing data gathered from forms.
>
> I have a basic understanding of html/javascript, and would appreciate
> any advice on where to concentrate my education to achieve the results
> above.
> My first guess would be PHP/MySQL which is why I'm posting here?
> Are there any ready-rolled solutions available that could be adapted?
> I'm going to setup an apache webserver this wend and experiment a
> little, but I don't want to have to re-invent the wheel... ;)
>
> Any pointers most appreciated,
>
> Dave.


So far as the access restriction, it's done with session vars that are
set upon a successful database query.

You run the queries based on the user & password entered into the login
page. You don't necessarily have to use the results of the query,
you're just checking to see if the user & PW matched (i.e., the query
returns a row of data), but the actual query could return their email
address, full name, whatever. It doesn't need to return the user or
pass because they've already entered that into the login form; you're
just checking to make sure they match.

If the query is successful they've entered the right info, you set the
appropriate session var and continue loading the desired page. If not,
you do an update query to another table, logging the incorrectly entered
info (plus any other pertinent info you may want to track, such as the
IP, time, etc.), then redirect to a "Sorry, wrong credentials" page.

You can also have the query pull a 'group' field which would grant
access to certain pages for certain users. This would be another
session var.

Each page you want to restrict first checks for the session vars, and if
they're not present, redirects to an "Oops" page, otherwise continues
loading as normal.
Sponsored Links







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

Copyright 2010 codecomments.com