Jump to content

how to prevent certain characters from being used


MDanz

Recommended Posts

The simplest and easiest way is to strip them out before using the data:

 

$search_text = $_POST['search'];
$disallowed_chars = array(';', '\\', '/', '<', '>', '=');
$search_text = str_replace($disallowed_chars, '', $search_text);

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.