What are the ways to prevent SQL injection in PHP? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What are the ways to prevent SQL injection in PHP?

23rd Jul 2019, 7:12 AM
Vedang Chavan
Vedang Chavan - avatar
2 Answers
0
I use my own tool that I shared at https://her tools-asah.ml/htaccess/ with HTACCESS it is the most practical and safe way, of course according to me. But I have used it for a long time and so far it has worked well. The page that I recommend only supports Spanish language, but with google translate it is very understandable.
23rd Oct 2019, 4:58 PM
Adrián Manuel López Cosenza
Adrián Manuel López Cosenza - avatar
0
By configuring this according to your requirements you can achieve good protection.... # CREADO UTILIZANDO ASAH-HTACCESS El 23/10/2019 A Las 12:55:56 # @ https://asah.ml/htaccess.php/ # No Eliminar Su Archivo .htaccess - Modificarlo Bajo Su Propio Riesgo. Si usted va a modificar # el archivo .htaccess de su sitio web, primero asegúrece de haber hecho una copia de seguridad. # ---------------------------------------------------------------------------------------------- # ASAH: FIREWALL/LISTA NEGRA # ---------------------------------------------------------------------------------------------- # ASAH: [Obligar A Apache A Servir UTF-8 De Forma Predeterminada] AddDefaultCharset utf-8 # ---------------------------------------------------------------------------------------------- #php_flag display_errors off # Descomentar para activar # ---------------------------------------------------------------------------------------------- # ASAH: [Protección Contra DDOS - Limitando Subida De Archivos] LimitRequestBody 10240000 # ---------------------------------------------------------------------------------------------- # ASAH [Índice - INDEX] Options All -Indexes # ---------------------------------------------------------------------------------------------- # Paginas de Error ASAH - Servidor De Producción # ASAH: [Errores Personalizados Servidor Producción] ErrorDocument 400 /error/400.php ErrorDocument 401 /error/401.php ErrorDocument 403 /error/403.php ErrorDocument 404 /error/404.php ErrorDocument 500 /error/500.php # Para que esto funcione, debe existir un directorio [error] que contenga los archivos de error. # ---------------------------------------------------------------------------------------------- # ASAH:[Ocultar Extensiónes - HIDE EXTENSIONS] # Ocultar Extensión PHP RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule ^(.*)$ $1.php # Ocultar Extensión HTML RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}.html -f RewriteR
23rd Oct 2019, 4:59 PM
Adrián Manuel López Cosenza
Adrián Manuel López Cosenza - avatar