ddddd — 2012-12-16T15:47:10-05:00 — #1
hallo ,i want to ask you ,is it possible to make admin panel for my site without having a registration/login option for the site
i mean i want users to have thi option to leave comments without asking login ,but i want to make admin panel also so i can delete some comments if it
s needed.but how to tell php that im admin without having login form ?
marplo — 2012-12-17T05:22:03-05:00 — #2
You can use $_SESSION.
Create a page with a form field for password. The form sends data to a php file in which you have defined a variable with your password.
If the password added in form is the same with the password in variable, sets a session for logged admin.
Then, make your script to display "delete" button, and to can delete the comments only if the session with logged admin is defined.
Use session_start(); at the beginning of php files.