Jump to content

Recommended Posts

hello there guys,

 

im working on a lil project and im very stuck  :(

 

i have a script which works great.  it allows me to add, edit and delete records in a mysql database.

 

the thing is, this page needs only be accessible by us guys in the IT dept.  i have a login "package" from a previous site which uses mysql for the users, and has what i think is refered to as a library? (the contents of all pages is in 1 document, and all the pages refer to functions on the library page to pull what information is displayed)

 

anyway, i put the code for my record editing thing in a new function in the library, but when i go to the page, it doesn't work.  it shows the form and the mysql table and records, but i cant edit, add or delete any records :(

 

any idea's why this could be happening? or do you know of any other login packages that only refer you to the destination page once you've logged in?

 

any help is greatly appreciated

Link to comment
https://forums.phpfreaks.com/topic/140814-how-to-do-a-secure-page/
Share on other sites

When you find a tutorial on the subject all will be explained. You basically check the users session to make sure they have permission to access the page. eg;

 

if (!isset($_SESSION['is_logged_in'])) {
  header("Location: http://domain.com/login.php");
} else {
  // display page.
}

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.