jacklindsay1990 Posted January 14, 2009 Share Posted January 14, 2009 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 Quote Link to comment Share on other sites More sharing options...
trq Posted January 14, 2009 Share Posted January 14, 2009 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? Probably better to write your own so as you understand its workings. Googling 'php login tutorial' should bring back many results. Quote Link to comment Share on other sites More sharing options...
jacklindsay1990 Posted January 15, 2009 Author Share Posted January 15, 2009 ok i'll have a look, but how do i create this so that this page is only accessible if you login ? Quote Link to comment Share on other sites More sharing options...
trq Posted January 15, 2009 Share Posted January 15, 2009 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. } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.