acctman Posted September 13, 2008 Share Posted September 13, 2008 Hi can someone explain the IF statement below too me? I kind of understand whats going on, it's looping though the post and i think its stripping HTML tags if present from the values..., am I correct? I don't get the "allowed_html" at the end. Also the second IF statement has two ";" at the end, which i've never seen done before is that just an error? thanks in advance if (is_array($_POST['add'])) foreach ($_POST['add'] as $key => $value) $_POST['add'][$key] = strip_tags(stripslashes($value),allowed_html); if (is_array($_POST['edit_add'])) foreach ($_POST['edit_add'] as $key => $value) $_POST['edit_add'][$key] = strip_tags(stripslashes($value),allowed_html);; Quote Link to comment https://forums.phpfreaks.com/topic/124074-solved-explain-this-code-to-me-please/ Share on other sites More sharing options...
Mchl Posted September 13, 2008 Share Posted September 13, 2008 Double ;; is just a typo. It's not even an error. Now for this allowed_html thing. strip_tags() function has two arguments. One is a string in which tags are to be removed. Second one is optional, and it describes tags, that should be left in processed string. Check if you have a constant called allowed_html defined somewhere before that code. Quote Link to comment https://forums.phpfreaks.com/topic/124074-solved-explain-this-code-to-me-please/#findComment-640571 Share on other sites More sharing options...
acctman Posted September 13, 2008 Author Share Posted September 13, 2008 Double ;; is just a typo. It's not even an error. Now for this allowed_html thing. strip_tags() function has two arguments. One is a string in which tags are to be removed. Second one is optional, and it describes tags, that should be left in processed string. Check if you have a constant called allowed_html defined somewhere before that code. thanks. there is no constant above the code for allow_html. i understand now how to edit the coding now Quote Link to comment https://forums.phpfreaks.com/topic/124074-solved-explain-this-code-to-me-please/#findComment-640576 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.