Hi ppl. Im here concering the stripslashes() function! For some reason it isnt working properly for me. Let me explain the problem...
I have a login.php page which holds nessarary data (variables) in a hidden feild from a previous page (news.php) When I login the header takes me to the edit_news.php. The text area has a $_GET function to get the data out of the header (the news text). If I have quotes in my post they get displayed in the edit news text area as...
example:
I\\\\'m
Thats 7 unnessarsay slashes.
I used the following code to get rid of them:
<?php set_magic_quotes_runtime(0);
if (get_magic_quotes_gpc ()) {
array_stripslashes($_POST);
array_stripslashes($_GET);
array_stripslashes($_COOKIES);
}
function array_stripslashes(&$array) {
while (list($key) = each($array)) {
if (is_array($array[$key])) {
stripslashes_array($array[$key]);
} else {
$array[$key] = stripslashes($array[$key]);
}
}
}
?>
Results as follows:
Before:
I\\\\'m
After
I\\'m
For some reason the stripslashes() function isnt getting rid of all the slashes, its left 3 there. Why? help appreciated! Thx.