Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create a secure admin-only section for a php website

Tags:

php

https

I have created a website and I want to create a control panel for it. Apart from the obvious login for the admin, could you please name a few common practices to make this part of the website more secure? I mean the techniques that are used different in these kind of pages from those in the normal (user) pages.

like image 734
Alireza Noori Avatar asked May 30 '26 03:05

Alireza Noori


1 Answers

You want to focus on keeping your credentials safe:

  • Use htmlspecialchars() on anything sent to your server to prevent XSS.
  • Use cryptogrpahic functions like SHA1() + Salt for your user passwords.
  • Use Anti-CSRF Token's.
  • Use Paramaterized Queries or Prepared Statements for database calls.
  • HTTPS never hurts.
like image 175
Dan Kanze Avatar answered Jun 01 '26 15:06

Dan Kanze



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!