php-general Digest 21 Jul 2013 19:46:44 -0000 Issue 8305
php-general Digest 21 Jul 2013 19:46:44 - Issue 8305 Topics (messages 321665 through 321665): Re: strip_tags 321665 by: Matijn Woudt Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Op 21 jul. 2013 02:53 schreef Tedd Sperling t...@sperling.com het volgende: On Jul 20, 2013, at 5:34 PM, Frank Arensmeier farensme...@gmail.com wrote: 20 jul 2013 kl. 18:25 skrev Tedd Sperling t...@sperling.com: Hi gang: I've been using $str = strip_tags($str, $allowable) as it is described via the manuals: http://php.net/manual/en/function.strip-tags.php The problem I've found is the tags br and br / are not stripped. How do you strip all tags, but leave some tags (such as b, i, and u -- I know these are depreciated, but my client wants them anyway). From the manual: allowable_tags You can use the optional second parameter to specify tags which should not be stripped. Note: HTML comments and PHP tags are also stripped. This is hardcoded and can not be changed with allowable_tags. Note: This parameter should not contain whitespace. strip_tags() sees a tag as a case-insensitive string between and the first whitespace or . It means that strip_tags(br/, br) returns an empty string. It's all there… ;-) Cheers, /frank Yeah, but that wasn't the problem -- it was my mistake in coding. In any event, I figured it out. tedd Could you perhaps post what the problem was so that when someone searches for it they will have the answer right here? - Matijn ---End Message---
Re: [PHP] query order issue
On 7/20/2013 9:21 AM, dealTek wrote: Hi all, I have a page that starts with several mysql sql query searches and displays data below... then I added a form (with hidden line do-update value UPDATE) on the same page with action to same page... then above other sql queries - I put... if ((isset($_POST[do-update])) ($_POST[do-update] == update)) { ---do update query--- echo 'meta http-equiv=refresh content=0; url=gohere.php'; By your description of what you think should be happening in the line above, my suggestion to would be to look at the header() function in PHP. It can send a header to the browser that will cause the browser to stop loading the current page and redirect it to another URL. http://php.net/header if ( ... ) { Do some work... header('Location: someotherpage.php'); exit(); } You want to make sure you always call exit(); after issuing a call to header('Location: ...'); } but it shows error that happens AFTER the meta http-equiv=refresh has happened Catchable fatal error: xxx on line 226 BTW - the meta http-equiv=refresh does work but the error flashes 1st for a second... Q: I would have thought that it would not go past the line - meta http-equiv=refresh - but it does any insight on this -- Thanks, Dave - DealTek deal...@gmail.com [db-3] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] strip_tags
Op 21 jul. 2013 02:53 schreef Tedd Sperling t...@sperling.com het volgende: On Jul 20, 2013, at 5:34 PM, Frank Arensmeier farensme...@gmail.com wrote: 20 jul 2013 kl. 18:25 skrev Tedd Sperling t...@sperling.com: Hi gang: I've been using $str = strip_tags($str, $allowable) as it is described via the manuals: http://php.net/manual/en/function.strip-tags.php The problem I've found is the tags br and br / are not stripped. How do you strip all tags, but leave some tags (such as b, i, and u -- I know these are depreciated, but my client wants them anyway). From the manual: allowable_tags You can use the optional second parameter to specify tags which should not be stripped. Note: HTML comments and PHP tags are also stripped. This is hardcoded and can not be changed with allowable_tags. Note: This parameter should not contain whitespace. strip_tags() sees a tag as a case-insensitive string between and the first whitespace or . It means that strip_tags(br/, br) returns an empty string. It's all there… ;-) Cheers, /frank Yeah, but that wasn't the problem -- it was my mistake in coding. In any event, I figured it out. tedd Could you perhaps post what the problem was so that when someone searches for it they will have the answer right here? - Matijn