php-general Digest 21 Jul 2013 07:37:43 -0000 Issue 8304
Topics (messages 321659 through 321664):
strip_tags
321659 by: Tedd Sperling
321662 by: Frank Arensmeier
321663 by: Tedd Sperling
Re: query order issue
321660 by: Jim Giner
321661 by: Jim Giner
321664 by: Jim Lucas
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
----------------------------------------------------------------------
--- Begin Message ---
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).
Cheers,
tedd
_____________________
t...@sperling.com
http://sperling.com
--- End Message ---
--- Begin Message ---
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
> Cheers,
>
> tedd
>
> _____________________
> t...@sperling.com
> http://sperling.com
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
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
_____________________
t...@sperling.com
http://sperling.com
--- End Message ---
--- Begin Message ---
On 7/20/2013 12:21 PM, 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">';
}
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]
YOu are checking for a value of 'update' but you stated that the value
clause was 'UPDATE'
--- End Message ---
--- Begin Message ---
On 7/20/2013 12:21 PM, 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">';
}
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]
YOu are checking for a value of 'update' but you stated that the value
clause was 'UPDATE'
--- End Message ---
--- Begin Message ---
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]
--- End Message ---