[PHP] Stripping HTML tags, but keeping entities...

2002-11-20 Thread David Russell
Hi all I have a text field that users can enter any information into (it is supposed to be a description field) For obvious reasons, I want to strip unfriendly HTML/PHP tags. This I am doing using: strip_tags($_POST['Duplicate'], 'B I P A LI OL UL EM BR TT STRONG BLOCKQUOTE DIV ECODE '); OK,

Re: [PHP] Stripping HTML tags, but keeping entities...

2002-11-20 Thread Justin French
on 21/11/02 2:25 AM, David Russell ([EMAIL PROTECTED]) wrote: strip_tags($_POST['Duplicate'], 'B I P A LI OL UL EM BR TT STRONG BLOCKQUOTE DIV ECODE '); OK, so this is cool. I got this list from the Slashdot allowed tags list, which I would assume is ok. Whoa there... NEVER assume because

RE: [PHP] Stripping specific tags

2002-09-19 Thread John Holmes
I was wondering is there a way to strip ONLY the tags that you specify from a page, rather than having to include all the tags you do want (using strip_tags() ) A regular expression or str_replace() would be best for this. Realize this isn't a good method, though. What if you're trying to

RE: [PHP] Stripping specific tags

2002-09-19 Thread John Holmes
That's what I thought the answer would be. I guess I will have to see if I can create a function to add to the next release of PHP to do this, as there certainly seems to be quite a demand for it, according to the archives anyway. I hope not. That would be a worthless function to have. Did

Re: [PHP] Stripping specific tags

2002-09-19 Thread Justin French
on 20/09/02 1:14 PM, John Holmes ([EMAIL PROTECTED]) wrote: I hope not. That would be a worthless function to have. Did you read my post? The basic idea is validation is to allow what you _know_ is good, and kill the rest. You don't kill a couple things you know are bad, then assume the rest

[PHP] Stripping specific tags

2002-09-18 Thread Alexis Antonakis
Hi, I was wondering is there a way to strip ONLY the tags that you specify from a page, rather than having to include all the tags you do want (using strip_tags() ) Cheers Alexis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] stripping quotes within an image tag

2002-07-31 Thread electroteque
hi how is it possible to strip quotes from an image tag ? i need IMG height=44 alt=hspace=0 src=blah.jpg width=148 border=0 to look like IMG height=44 alt=hspace=0 src=blah.jpg width=148 border=0 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] stripping quotes from urls and images

2002-07-31 Thread electroteque
hi guys i now have a problem with urls i need to remove the quotes from both href= and src= so a href=blah img src= needs to be a href= img src= and i cant remove quotes from all string matches :| -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] Stripping illegal characters out of an XML document

2002-06-06 Thread Daniel Pupius
Hi there. I'm working with RDF/XML that is strict on what characters are allowed within the elements and attributes. I was wondering if anyone had a script that processed a string and replaced all illegal-characters with their HTML code, for example is converted to and to . It should also work

Re: [PHP] Stripping illegal characters out of an XML document

2002-06-06 Thread Analysis Solutions
On Thu, Jun 06, 2002 at 12:47:57PM +0100, Daniel Pupius wrote: Hi there. I'm working with RDF/XML that is strict on what characters are allowed within the elements and attributes. I was wondering if anyone had a script that processed a string and replaced all illegal-characters with their

Re: [PHP] Stripping illegal characters out of an XML document

2002-06-06 Thread Daniel Pupius
Thanks, I've created a delimited file of all the HTML Character references. I then loop through and do a replace as previously suggested. However, IE's XML Parser still doesn't like the eacute; which represents é For all intents and purposes it's ok and works with the RDF processor. However,

Re: [PHP] Stripping illegal characters out of an XML document

2002-06-06 Thread Analysis Solutions
Heya: On Thu, Jun 06, 2002 at 04:54:15PM +0100, Daniel Pupius wrote: Thanks, I've created a delimited file of all the HTML Character references. I then loop through and do a replace as previously suggested. However, IE's XML Parser still doesn't like the eacute; which represents é For

[PHP] Stripping characters.....

2002-04-28 Thread CDitty
Hello all, Does anyone have any snippets of code that will strip several characters from a string? I am trying to figure out how to do this without using 3 different if statement blocks. This is what I am looking for. ieUser email address is Chris Ditty [EMAIL PROTECTED] or Chris

Re: [PHP] Stripping characters.....

2002-04-28 Thread Justin French
Clarification: So really, what you want to achieve is to ONLY have the email address? I'm POSITIVE there's a better way with ereg_replace(), but I haven't got time to experiment, and i'm no expert :) So, what I figured was that you would loop through the $email, and if the first char wasn't a ,

[PHP] Stripping the first line of a file

2002-02-08 Thread Scott
Hi, I want to be able to open a file and then strip the first line of it off. Example, the first line contains the names for tables in a database and all I need is from the second line on. if I fopen a file can I strip the line or should I process it and then drop the data from the first

RE: [PHP] Stripping the first line of a file

2002-02-08 Thread Jerry Verhoef (UGBI)
-Original Message- From: Scott [mailto:[EMAIL PROTECTED]] Sent: Friday, February 08, 2002 4:02 PM To: [EMAIL PROTECTED] Subject: [PHP] Stripping the first line of a file Hi, I want to be able to open a file and then strip the first line of it off. Example, the first line contains

RE: [PHP] Stripping the first line of a file

2002-02-08 Thread Scott
Thank you! Works. I have a few more questions! I am working on converting a program from perl to PHP as it is the new language of choice at our office. I have been using printf statements in perl to format data. Is there a similar funtion in php? Here is an example from the perl program:

RE: [PHP] Stripping the first line of a file

2002-02-08 Thread Jerry Verhoef (UGBI)
, 2002 4:22 PM To: Jerry Verhoef (UGBI) Cc: [EMAIL PROTECTED] Subject: RE: [PHP] Stripping the first line of a file Thank you! Works. I have a few more questions! I am working on converting a program from perl to PHP as it is the new language of choice at our office. I have been using

RE: [PHP] Stripping the first line of a file

2002-02-08 Thread Jerry Verhoef (UGBI)
printf NEW (%-193.193s); printf (%-193.193s,VARIABLE); HTH -Original Message- From: Jerry Verhoef (UGBI) [mailto:[EMAIL PROTECTED]] Sent: Friday, February 08, 2002 4:35 PM To: 'Scott'; Jerry Verhoef (UGBI) Cc: [EMAIL PROTECTED] Subject: RE: [PHP] Stripping the first line

RE: [PHP] Stripping the first line of a file

2002-02-08 Thread Scott
Thanks Jerry! In perl I was doing this: printf NEW (%-193.193s); Which I just read the manual and discovered it works in PHP as well. Basically prints 193 spaces to make sure the line is 255 after I filled the line with other characters. On Fri, 8 Feb 2002, Jerry Verhoef (UGBI) wrote:

[PHP] stripping high ascii from a string

2002-01-08 Thread bill
Is there a function that can strip high ascii from a string? thanks, bill -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]

[PHP] Stripping slashes from db-insert?

2001-12-01 Thread Daniel Alsén
Hi, i know this has been asked before - but: When i add entries to MySql (varchar and text) all and ' gets a slash in front of them. How do i get rid of these slashes? Regards # Daniel Alsén| www.mindbash.com # # [EMAIL PROTECTED] | +46 704 86 14 92 # # ICQ: 63006462 | +46 8 694 82 22

Re: [PHP] Stripping slashes from db-insert?

2001-12-01 Thread Shane Wright
Addslashes() is probably getting called twice on the data on the insert... if you have magic_gpc on, any inputted data already has the necessary escapes - so you shouldnt need to call it again... Hope that helped :) -- Shane On Saturday 01 Dec 2001 1:14 pm, Daniel Alsén wrote: Hi, i know

[PHP] Stripping Unwanted Characters

2001-11-24 Thread Robert Miller
I'm posting this (see below) for two reasons: 1. so that others may benefit, and 2. to invite feedback on my code (PHP is the first language I have learned... and I've only been doing this for a week or so). Cheers, Rob P.S. Has anyone found a good way to parse variables to validate specific

[PHP] Stripping line break characters

2001-08-25 Thread Rory O'Connor
I need to strip line break characters (or whatever the character is that results from users hitting their enter key inside a TEXTAREA form input) from a string. These characters will appear anywhere in the string, not just at the end. In perl, the regex would look something like this...

RE: [PHP] Stripping single quotes

2001-07-28 Thread Matt Stone
[mailto:[EMAIL PROTECTED]] Sent: Saturday, 28 July 2001 2:15 PM To: Matt Stone Cc: PHP list Subject: Re: [PHP] Stripping single quotes Matt, Try ereg_replace:- $fldemail == ereg_replace(',,$fldemail); Chris Matt Stone wrote: Hi all, I am trying to validate some email addresses before

RE: [PHP] Stripping single quotes

2001-07-28 Thread Michael Hall
:15 PM To: Matt Stone Cc: PHP list Subject: Re: [PHP] Stripping single quotes Matt, Try ereg_replace:- $fldemail == ereg_replace(',,$fldemail); Chris Matt Stone wrote: Hi all, I am trying to validate some email addresses before they are entered into the database

RE: [PHP] Stripping single quotes

2001-07-28 Thread Matt Stone
Thanks for your help everyone, I feel pretty embarrassed to have made a mistake like that! :o -Original Message- From: Bojan Gajic [mailto:[EMAIL PROTECTED]] Sent: Sunday, 29 July 2001 12:44 AM To: Matt Stone Subject: Re: [PHP] Stripping single quotes you are not assigning

[PHP] Stripping single quotes

2001-07-27 Thread Matt Stone
Hi all, I am trying to validate some email addresses before they are entered into the database. The problem is, some thick or malicious people are entering single quotes into their email addresses. I need to strip out all these single quotes but a little ole' str_replace doesn't seem to be

Re: [PHP] stripping white space?

2001-07-10 Thread Bart Veldhuizen
Hi Brian, * Persuade someone at Zend to modify PHP so that a filter function can be specified which all output text is passed through - would have the same restrictions as the header function You can already achieve this by using the built-in output buffering function. Read

RE: [PHP] stripping white space?

2001-07-10 Thread Navid A. Yar
astray from them, else we know the headaches us developers can face in the future. Sincerely, Navid Yar -Original Message- From: Maxim Maletsky [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 10, 2001 1:06 AM To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED] Subject: RE: [PHP] stripping

Re: [PHP] stripping white space?

2001-07-10 Thread Bart Veldhuizen
Hi Maxim, 1. HTTP compression, which is not 100% compatible, but catches most of the browsers anyway. Yes. The standard PHP implementation actually inspects the HTTP headers to determine if the browser supports gzip encoding. If not, it will send the files uncompressed. Looking at our website

Re: [PHP] stripping white space?

2001-07-10 Thread Bart Veldhuizen
]] Sent: Tuesday, July 10, 2001 6:07 PM To: Maxim Maletsky; [EMAIL PROTECTED] Subject: Re: [PHP] stripping white space? Hi Maxim, I am definitely interested in seeing your caching modules - it could be a useful resource for ours. Right now our caching module is only in the planning stage

Re: [PHP] stripping white space?

2001-07-10 Thread Bart Veldhuizen
Hi Remo, PS: Can anyone enlighten me concerning HTTP compression? I wish I could remember where I read this, but the PHP documentation still does not have this feature described. To enable zlib output compression, first make sure you have compiled PHP with the --with-zlib option. Next, add the

RE: [PHP] stripping white space?

2001-07-10 Thread Chadwick, Russell
: Tuesday, July 10, 2001 9:52 AM To: Maxim Maletsky; 'Bart Veldhuizen'; [EMAIL PROTECTED] Subject: Re: [PHP] stripping white space? On Tuesday 10 July 2001 11:26, Maxim Maletsky wrote: But you're right, on UNIX systems, if I am not wrong, you cannot hold more then 1024 (?) files in a single

RE: [PHP] stripping white space?

2001-07-10 Thread Brian White
. Sincerely, Navid Yar -Original Message- From: Maxim Maletsky [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 10, 2001 1:06 AM To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED] Subject: RE: [PHP] stripping white space? Yeah, I know that XML requires it. And I also know that it is not a good

[PHP] stripping white space?

2001-07-09 Thread Kurt Lieber
Is there a way using PHP to easily strip white space out of an html page as it's being sent to the client. That is to say, the page that we as developers work on is nicely formatted, indented, etc. but when it's sent out to the client, PHP will remove all the extra white space both to obfuscate

Re: [PHP] stripping white space?

2001-07-09 Thread Mukul Sabharwal
Hi, I take that you simply want to remove ALL whitespaces from a data block (variable). you could simply use str_replace( , , $var); --- Kurt Lieber [EMAIL PROTECTED] wrote: Is there a way using PHP to easily strip white space out of an html page as it's being sent to the client. That is

RE: [PHP] stripping white space?

2001-07-09 Thread Jack Dempsey
Sabharwal [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 10, 2001 1:05 AM To: Kurt Lieber; [EMAIL PROTECTED] Subject: Re: [PHP] stripping white space? Hi, I take that you simply want to remove ALL whitespaces from a data block (variable). you could simply use str_replace( , , $var); --- Kurt

Re: [PHP] stripping white space?

2001-07-09 Thread Kurt Lieber
Sabharwal [EMAIL PROTECTED] To: Kurt Lieber [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, July 09, 2001 10:04 PM Subject: Re: [PHP] stripping white space? Hi, I take that you simply want to remove ALL whitespaces from a data block (variable). you could simply use str_replace( , , $var

Re: [PHP] stripping white space?

2001-07-09 Thread Kurt Lieber
. --kurt - Original Message - From: Chris Lambert - WhiteCrown Networks [EMAIL PROTECTED] To: Kurt Lieber [EMAIL PROTECTED] Sent: Monday, July 09, 2001 10:11 PM Subject: Re: [PHP] stripping white space? Nothing can _easily_ do this, as HTML puts formatting and content on the same page. You

RE: [PHP] stripping white space?

2001-07-09 Thread Navid A. Yar
... -Original Message- From: Maxim Maletsky [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 10, 2001 12:16 AM To: '[EMAIL PROTECTED]'; Kurt Lieber; [EMAIL PROTECTED] Subject: RE: [PHP] stripping white space? I would not be stripping white spaces, but double white spaces into single ' '; for example

Re: [PHP] stripping white space?

2001-07-09 Thread Mark Charette
From: Maxim Maletsky [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, July 10, 2001 1:05 AM Subject: RE: [PHP] stripping white space? I think it IS a good practice if you only practicing HTML to be outputted by PHP. Why, if you know that it's illegal XHTML and XML

Re: [PHP] stripping tags with regex ?

2001-04-03 Thread Christian Reiniger
On Tuesday 03 April 2001 17:57, you wrote: I have this image.../image or image left.../image or image right.../image or image top.../image I want to strip the all that out of my text. I havent a clue about regex, I wish I did. could I get some insight, even a site to learn a little

Re: [PHP] stripping tags with regex ?

2001-04-03 Thread Chris Lee
I was interested in stripping the content between the tags too though. the content between the tags is allways 18 char so I did this. $article_body = ereg_replace("image+.{18}/image ", '', $article_body); that seemed to work. oi, regex is bad stuff, haha. -- Chris Lee [EMAIL

Re: [PHP] stripping tags with regex ?

2001-04-03 Thread Christian Reiniger
On Tuesday 03 April 2001 19:57, you wrote: I was interested in stripping the content between the tags too though. the content between the tags is allways 18 char so I did this. $article_body = ereg_replace("image+.{18}/image ", '', $article_body); that seemed to work. oi, regex is bad

Re: [PHP] Stripping Single Quotes

2001-03-15 Thread CC Zona
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Elan) wrote: I have a string, "'abc'". How do I convert it to "abc" (i.e. how do I strip the embedded single quotes) with a minimum of overhead? If there's no chance that the string could also contain legit single-quotes (such as as an

Re: [PHP] Stripping Single Quotes

2001-03-15 Thread Web master
use the following code $vals=explode("'", "'abc'"); $your_value=$vals[0]; //I am little confused, if it is not working try index1 Elan wrote: Hi, I have a string, "'abc'". How do I convert it to "abc" (i.e. how do I strip the embedded single quotes) with a minimum of overhead? (In case

Re: [PHP] Stripping HTML selectively?

2001-03-04 Thread Steve Edberg
At 09:43 PM 3/3/01 , Erick Papadakis wrote: Thanks Brian, I have tried the allowable tags, but I need to remove the ATTRIBUTES of a tag, not the tag itself. STRIP_TAGS totally removes the tag, and ALLOWABLE_TAGS lets the tag be. WHat I wish to do is let the main tag be but remove its attributes,

Re: [PHP] Stripping HTML selectively?

2001-03-03 Thread Erick Papadakis
Thanks Brian, I have tried the allowable tags, but I need to remove the ATTRIBUTES of a tag, not the tag itself. STRIP_TAGS totally removes the tag, and ALLOWABLE_TAGS lets the tag be. WHat I wish to do is let the main tag be but remove its attributes, as follows: Original text: font

[PHP] Stripping HTML selectively?

2001-03-02 Thread Erick Papadakis
Hello, need some help. i need to take an HTML file that is written by a user in a very bad format, for instance: font class="sometihng" style=""Hi!/font and get the following: fontHi!/font i tried to look at "strip_tags" but then it only returns me: Hi! thanks in

Re: [PHP] Stripping HTML selectively?

2001-03-02 Thread Brian Clark
Hi Erick, @ 12:22:39 AM on 3/3/2001, [EMAIL PROTECTED] wrote: i tried to look at "strip_tags" but then it only returns me: http://www.php.net/manual/en/function.strip-tags.php string strip_tags (string str [, string allowable_tags]) "Note: Allowable_tags was added in PHP 3.0.13, PHP4B3."

Re: [PHP] stripping the keywords from a search engine... again...

2001-01-19 Thread Robin Vickery
"BC" == Brian Clark [EMAIL PROTECTED] writes: Hello Dallas, (DK == "Dallas Kropka") [EMAIL PROTECTED] writes: DK Posted earlier but got no response so here it is again... I gave you a quick explanation of one way to do it earlier, but I know of no tutorials off the top of my

[PHP] stripping the keywords from a search engine... again...

2001-01-17 Thread Dallas Kropka
Posted earlier but got no response so here it is again... Ok, I need either a tutorial or someone who has done so in the past to tell me how to do this I want to log and reference the key words used to find my site from referring search engines... like so: AltaVista: 211

Re: [PHP] stripping the keywords from a search engine... again...

2001-01-17 Thread Brian Clark
Hello Dallas, (DK == "Dallas Kropka") [EMAIL PROTECTED] writes: DK Posted earlier but got no response so here it is again... I gave you a quick explanation of one way to do it earlier, but I know of no tutorials off the top of my head. Here is a lengthy example if you _have_ to see

[PHP] Stripping!!!

2001-01-11 Thread K.Simon
I have a file with 45000 newsgroups in there. It looks like that: alt.1d 070753 057290 y alt.2600 515487 435743 y alt.3d 073441 059461 y alt.abortion.inequity 272142 227847 y alt.abuse-recovery 36 36 m alt.abuse.recovery 137940 021046 y

Re: [PHP] Stripping!!!

2001-01-11 Thread Robin Vickery
"S" == "K Simon" [EMAIL PROTECTED] writes: Thx, but could anybody give me an example? It shouldnt be too hard?! If you feel you have to do it in php then this should work. You'd save a lot of effort if you used the unix 'cut' command though. cut -d ' ' -f 1 inputfile.txt outputfile.txt

<    1   2