hi all,
i'm trying to figure out how i can create/control account with privileges, for instance an Administrator creates an account but gives it guest privileges (able to see data but not edit, or delete it, not able to create users).
when a user logs in, i store his/her privileges is a session.
Code: $_SESSION['staff_privilege'] = $found_user['privilege'];
i wrote this function to check for privileges and placed it in the create user page. (1 = admin, 2 = guest)
Code: function get_privilege() {
if (logged_in() && isset($_SESSION['staff_privilege'])) {
if ($_SESSION['staff_privilege'] == 2) {
redirect_to("../staff/staff_browse.php?privilege=false");
}
} else {
redirect_to("../staff/index.php");
}
}
for instance if a user with guest privileges goes to create user page, he/she will get redirect to another page showing a message.
the above code is working, but i'm wanted other ideas about how this could be accomplished in another way
thanks
How can I Compare two xml documents?
Hi all,
storing video files into mysql in php
hi i have my video files in my folder ,i have to store the path of the videos into db and the play it in the player from the database.thanking in advance
Calculating n! using vector
#include <cstdio>
Table Control
Hi Guru's,
Blank record injected into database
I always found several blank records inside my database, although $SESSION is required to insert the data into database.Why can this happen? how to prevent this?
Little problem with form insertion in MySQL, Please help!!!
Hi!,I'm a little bit new with php and I have a little issue here. I created a webform to insert some infos into a MySQL database. The weird thing is that some of the infos is correctly inserted and
Set Categories
I am creating a submission form for somebody to come in and submit products. These products are separated by brand. How can I get them to display according to the brand?Here is the form code:Code:
having a small php error tha deals with the 'foreach'
Last night i was working on a script for a cart and it seemed to working good, until this morning. For some reason i'ts giving me the following error:Warning: Invalid argument supplied for foreach()
Credit card verification
I have a client who wants to process credit card transactions from his web site rather than the going through something like paypal. I've never done that before...what is my first step? I really dont
ob_ dynamic content
i was wondering about the potential to use ob to create a <div then remove it when the page has finished loading? ie loading cover.