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 :: wp_get_attachment_url 
Php :: ckeditor laravel 
Php :: laravel npm run dev mix error FIX 
Php :: php get data from url 
Php :: In PackageManifest.php line 122: Undefined index: name 
Php :: laravel log level 
Php :: user location using php 
Php :: laravel model update table 
Php :: return json in middleware laravel 
Php :: wordpress get plugin root directory 
Php :: check mobile or email in laravel 
Php :: docker php 7.2 add ext-mongodb 
Php :: laravel auth check login 
Php :: display image from mysqli database 
Php :: laravel override factory values in database seeder 
Php :: get server ip php 
Php :: check if value change laravel 
Php :: php numbers 
Php :: Laravel - Query Builder Raw Query selectRaw 
Php :: Eloquent models events 
Php :: php loop html select option 
Php :: special characters in php 
Php :: how to get data from json array in php 
Php :: how to return chunk data laravel 
Php :: set posts_per_page 
Php :: Custom Font Laravel 
Php :: php check if link exists 
Php :: select multiple option in laravel 
Php :: laravel DB wherein 
Php :: get category of current post wordpress 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =