Wysyłając formularz gdzie w inpucie wpiszemy np:
w wyniku otrzymamy:
temat: "książka czarowników"
czyli usunie nam to co mamy w " ", natomiast gdy wpiszemy
temat:
to wynik będzie:
temat"książka
temat\"książka
z php.net.pl oraz grupy dyskusyjnej wyciągnąłem kod:
<?php function stripslashes_array($array) { return is_array($array) ? array_map('stripslashes_array',$array) : stripslashes($array); } $_SERVER = stripslashes_array($_SERVER); $_GET = stripslashes_array($_GET); $_POST = stripslashes_array($_POST); $_COOKIE = stripslashes_array($_COOKIE); $_FILES = stripslashes_array($_FILES); $_ENV = stripslashes_array($_ENV); $_REQUEST = stripslashes_array($_REQUEST); $HTTP_SERVER_VARS = stripslashes_array($HTTP_SERVER_VARS); $HTTP_GET_VARS = stripslashes_array($HTTP_GET_VARS); $HTTP_POST_VARS = stripslashes_array($HTTP_POST_VARS); $HTTP_COOKIE_VARS = stripslashes_array($HTTP_COOKIE_VARS); $HTTP_POST_FILES = stripslashes_array($HTTP_POST_FILES); $HTTP_ENV_VARS = stripslashes_array($HTTP_ENV_VARS); } ?>
Ale i tak nic to nie dało.
Próbowałem dać np:
to działa ale gdy dodam do powyższego kodu dodatkową zmienną z drugiego inputa to już nie działa dla obu
<?php function stripslashes_array($array) { return is_array($array) ? array_map('stripslashes_array',$array) : stripslashes($array); } $tytul = stripslashes_array($tytul); // zmienna z jednego inputa $_SERVER = stripslashes_array($_SERVER); $_GET = stripslashes_array($_GET); $_POST = stripslashes_array($_POST); $_COOKIE = stripslashes_array($_COOKIE); $_FILES = stripslashes_array($_FILES); $_ENV = stripslashes_array($_ENV); $_REQUEST = stripslashes_array($_REQUEST); $HTTP_SERVER_VARS = stripslashes_array($HTTP_SERVER_VARS); $HTTP_GET_VARS = stripslashes_array($HTTP_GET_VARS); $HTTP_POST_VARS = stripslashes_array($HTTP_POST_VARS); $HTTP_COOKIE_VARS = stripslashes_array($HTTP_COOKIE_VARS); $HTTP_POST_FILES = stripslashes_array($HTTP_POST_FILES); $HTTP_ENV_VARS = stripslashes_array($HTTP_ENV_VARS); } ?>
