Search
 
SCRIPT & CODE EXAMPLE
 

PHP

How can I prevent SQL injection in PHP?

//Connect
$unsafe_variable = $_POST["user-input"];
$safe_variable = mysql_real_escape_string($unsafe_variable);

mysql_query("INSERT INTO table (column) VALUES ('" . $safe_variable . "')");
//Disconnect
Comment

prevent SQL injection in PHP?

$str = "<script>alert('Hacked')</script>";
echo htmlentities($str);
Comment

PREVIOUS NEXT
Code Example
Php :: laravel remove public from url 
Php :: php explode 
Php :: php get ip by domain 
Php :: check if $_files is empty php 
Php :: yii2 activeform adding field placeholder 
Php :: php json hjeader 
Php :: mySQL phpMyAdmin with Google Chrome: stuck on loading 
Php :: laravel migrate only one table 
Php :: check php version mac 
Php :: append new line php 
Php :: install symfony ubuntu 
Php :: phpspreadsheet applyFromArray wrap 
Php :: php get version 
Php :: php Error!: could not find driver 
Php :: .htaccess for laravel in hostinger 
Php :: laravel simplexmlelement xml add attribute 
Php :: laravel checkbox terms and conditions 
Php :: carbon in laravel 
Php :: codeigniter where_not_in 
Php :: php carbon convert string to date 
Php :: php return json response with status code 
Php :: how to get all rows from a table except some rows in laravel 
Php :: php get all values from associative array 
Php :: Where do php count start 
Php :: wp_query post by category id 
Php :: laravel wherehas 
Php :: strlen php 
Php :: dir name php 
Php :: how to one increment after post in laravel collective 
Php :: Allowed memory size of 1610612736 bytes exhausted 
ADD CONTENT
Topic
Content
Source link
Name
5+2 =