Jump to content

Admin panel


b2k

Recommended Posts

Well if you've created a script and added your own admin control to it, you seem like you know the basics of form input.

 

You can either just create a table to store your single admin password, or you could just store it in your PHP file (unless you're expecting someone to hack in to your site).  Then just do a simple form and check to see if the details they entered = the password you set.  If you're wanting to do sessions make sure you have session_start() at the top of every page you wish to use the sessions on.  Then you can simply use:

 

<?php $_SESSION['loggedIn'] = true; ?>

or something similar just to say they're logged in.  To check whether they're logged in or not you can use code such as:

<?php if(!$_SESSION['loggedIn']) { header("Location: notloggedin.php"; } ?>

 

Enjoy!

Link to comment
https://forums.phpfreaks.com/topic/87086-admin-panel/#findComment-445498
Share on other sites

Well if you've created a script and added your own admin control to it, you seem like you know the basics of form input.

 

You can either just create a table to store your single admin password, or you could just store it in your PHP file (unless you're expecting someone to hack in to your site).  Then just do a simple form and check to see if the details they entered = the password you set.  If you're wanting to do sessions make sure you have session_start() at the top of every page you wish to use the sessions on.  Then you can simply use:

 

<?php $_SESSION['loggedIn'] = true; ?>

or something similar just to say they're logged in.  To check whether they're logged in or not you can use code such as:

<?php if(!$_SESSION['loggedIn']) { header("Location: notloggedin.php"; } ?>

 

Enjoy!

 

I don't get it

Link to comment
https://forums.phpfreaks.com/topic/87086-admin-panel/#findComment-445751
Share on other sites

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.