View Single Post
Old 08-11-2022, 08:56 AM  
redwhiteandblue
Bollocks
 
redwhiteandblue's Avatar
 
Industry Role:
Join Date: Jun 2007
Location: Bollocks
Posts: 2,792
Try this, it may or may not work....

It should run through all the values in the $_POST array and make a new array with sanitized values.

Code:
$sanitized_post = [];
$dbc = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);

foreach($_POST as $key => $value)
{
	$sanitized_post[$key] = $dbc->real_escape_string($value);
}
redwhiteandblue is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote