Jump to content

how to do a secure page???


jacklindsay1990

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.
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.