RE: [PHP-DB] Implementing search in a database driven website
I found this PDF 'quick reference' quite useful as I am just starting to learn how to use regular expressions. http://www.erudil.com/pdf/preqr.pdf HTH Graham -Original Message- From: Vinayakam Murugan [mailto:[EMAIL PROTECTED] Sent: 27 October 2004 04:11 To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Implementing search in a database driven website Thanks, Robby. This worked. However I wasn't able to get any documentation on the siU parameters used in the command as in $string= preg_replace('style[^]*.*/style'siU,'',$string); Any pointers. -- Warm Regards Vinayak -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Implementing search in a database driven website
Hi I have a PHP-mysql website in which I want to implement search functionality. Through the content management section, the user can enter data into the database. Here he can enter HTML tags and embedded CSS stylesheets also. Now the problem is while searching the table, I want to show couple of lines of the relevant text. This gets displayed along with the HTML tags and CSS entries. Is there anyway I can display only the text ? I have tried strip_tags but it does not strip the CSS entries. -- Warm Regards Vinayak -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Implementing search in a database driven website
On Wed, 2004-10-27 at 00:33 +0530, Vinayakam Murugan wrote: Hi I have a PHP-mysql website in which I want to implement search functionality. Through the content management section, the user can enter data into the database. Here he can enter HTML tags and embedded CSS stylesheets also. Now the problem is while searching the table, I want to show couple of lines of the relevant text. This gets displayed along with the HTML tags and CSS entries. Is there anyway I can display only the text ? I have tried strip_tags but it does not strip the CSS entries. -- Warm Regards Vinayak You're going to have replace all the css tags when you pull the data out...or rethink how you handle this sort of stuff in your CMS. (html/css inside the content isn't fun to deal with) -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development / signature.asc Description: This is a digitally signed message part
Re: [PHP-DB] Implementing search in a database driven website
On Tue, 2004-10-26 at 16:57 -0700, Robby Russell wrote: On Wed, 2004-10-27 at 00:33 +0530, Vinayakam Murugan wrote: Hi I have a PHP-mysql website in which I want to implement search functionality. Through the content management section, the user can enter data into the database. Here he can enter HTML tags and embedded CSS stylesheets also. Now the problem is while searching the table, I want to show couple of lines of the relevant text. This gets displayed along with the HTML tags and CSS entries. Is there anyway I can display only the text ? I have tried strip_tags but it does not strip the CSS entries. -- Warm Regards Vinayak You're going to have replace all the css tags when you pull the data out...or rethink how you handle this sort of stuff in your CMS. (html/css inside the content isn't fun to deal with) -Robby found on php.net,http://us2.php.net/strip_tags (bottom) $string= preg_replace('style[^]*.*/style'siU,'',$string); -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development / signature.asc Description: This is a digitally signed message part
Re: [PHP-DB] Implementing search in a database driven website
regex replace them all bastien From: Robby Russell [EMAIL PROTECTED] To: Vinayakam Murugan [EMAIL PROTECTED] CC: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Implementing search in a database driven website Date: Tue, 26 Oct 2004 16:57:36 -0700 On Wed, 2004-10-27 at 00:33 +0530, Vinayakam Murugan wrote: Hi I have a PHP-mysql website in which I want to implement search functionality. Through the content management section, the user can enter data into the database. Here he can enter HTML tags and embedded CSS stylesheets also. Now the problem is while searching the table, I want to show couple of lines of the relevant text. This gets displayed along with the HTML tags and CSS entries. Is there anyway I can display only the text ? I have tried strip_tags but it does not strip the CSS entries. -- Warm Regards Vinayak You're going to have replace all the css tags when you pull the data out...or rethink how you handle this sort of stuff in your CMS. (html/css inside the content isn't fun to deal with) -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development / signature.asc -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Implementing search in a database driven website
Thanks, Robby. This worked. However I wasn't able to get any documentation on the siU parameters used in the command as in $string= preg_replace('style[^]*.*/style'siU,'',$string); Any pointers. -- Warm Regards Vinayak -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Implementing search in a database driven website
On Wednesday 27 October 2004 03:11, Vinayakam Murugan wrote: Thanks, Robby. This worked. However I wasn't able to get any documentation on the siU parameters used in the command as in $string= preg_replace('style[^]*.*/style'siU,'',$string); Any pointers. manual Regular Expression Functions (Perl-Compatible) Pattern Modifiers -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-db -- /* General Protection Fault! [ Ignore ] [ Reboot ] [ Install Linux ] -- From a Slashdot.org post */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php