ThisisLegal.com

ThisisLegal Forums

Welcome to the forums! A chance for site members to chat and get help.

You are not logged in.

#1 2009-09-23 09:44:15

therock_wall
Member
Registered: 2008-03-16
Posts: 45

object oriented php

can som1 provide good material for oo php !! how to manage users nd make dynamic pages  and provide correct authentication to users.. plz..

Offline

#2 2009-09-23 13:35:51

t0mmy9
Administrator
Registered: 2005-01-07
Posts: 21

Re: object oriented php

We (and im guessing some of our sites users) are pretty good at PHP. Explain more what you want and what you already have set up (DB structure etc) and people will be able to help you better.


Site admin

Offline

#3 2009-09-24 03:34:21

therock_wall
Member
Registered: 2008-03-16
Posts: 45

Re: object oriented php

Thanx for the suppor­t from ur side.. Actually i am on my engineering project.. working on online polling system.. and i hav sufficient knowledge in basic php . My database that i am suppose to use for the project is DB2 (IBM).The major issue is that i hav the knowledge of connecting to mySQL DB and make basic login script. But how do i manage the permissions such that the administrator can use the editor to edit or delete  any post and only the regidtered users can see specific pages . in short dude its a custom CMS i blieve.. so can u just guide me the righr way... thanx a lot in advance biggrin

Offline

#4 2009-09-24 12:11:07

t0mmy9
Administrator
Registered: 2005-01-07
Posts: 21

Re: object oriented php

Well, the easiest way would be to so something like add a column to the DB called for example "is_admin" and make is set a session if it is set to yes

if ($row['is_admin'] == "yes"){
session_start();
$_SESSION['is_admin'] = "yes";
}

then you could use a GET to get the value of the poll to edit / delete

if ($_SESSION['is_admin'] == "yes"){

if ($_GET['id']){

$id = $_GET['id'];

// connect to db info here, as well as select db

$q = mysql_query("DELETE * FROM poll WHERE ID='$id'") or die (mysql_error());
echo "deleted!";
}
}

syntax: delete_poll.php?id=ID_HERE

obviously the full script to do everything is too big to post on here, but that should get you started. Also, you will have to change a lot of things to fit your current code, and it isnt safe against hacking attempts tongue


Site admin

Offline

Board footer

Powered by FluxBB