Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php url variable xss sanitize


<?php
// It is important to sanitize
// input! Otherwise, a bad actor
// could enter '<script src="evilscript.js"></script>'
// in a URL parameter. Assuming you echo it, this
// would inject scripts in an XSS attack.
//
// The solution:
$NAME = $_GET['NAME'];
// Bad:
echo $NAME;
// that one is vulnerable to XSS
// Good:
echo htmlspecialchars($NAME);
// Sanitizes input thoroughly.
?>

Comment

PREVIOUS NEXT
Code Example
Php :: get posts with multiple meta value in wordpress 
Php :: how to get favicon with Goutte php 
Php :: laravel longblob migration 
Php :: truncate url rewrites magento 2 database 
Php :: php get locale active 
Php :: php filter_var name 
Php :: PHP is not configured to connect to MySQL 
Php :: remove MainWP Child phpmyadmin 
Php :: acf get all choices from select 
Php :: cut pice of text in laravel 
Php :: laravel digits between does not working 
Php :: php foreach multidimensional array recursive 
Php :: laravel compare request domain and app domain and request original domain 
Php :: laravel collection every 
Php :: get search query wordpress dev 
Php :: date in russian php 
Php :: how to redirect in php use variable from another file 
Php :: php serve a video (THE ONLY WORKING CODE) 
Php :: generate report daily weekly monthly php mysql 
Php :: Pure Intersection Types - PHP 8.1 
Php :: hasmany relation in laravel 
Php :: Laravel unique with Validation with multiple input value 
Php :: woocommerce order get product weight 
Php :: laravel zoom integration 
Php :: document ready wordpress 
Php :: wpquery search taxonomy 
Php :: how to set 1 year date without saturday in while loop php 
Php :: unset method 
Php :: laravel map the output of the api 
Php :: laravel collection union 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =