Jump to content

Admin panel


b2k

Recommended Posts

Hi,

 

I already created an script, and recently i added an admin panel to the script, my question now, is how i can put some security to the Panel, like password, session or something like.

 

I need that somebody give me some reference about how to do it.

 

Cheers!

Link to comment
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!

Link to comment
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
Share on other sites

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.