You are here: Re: strip-tags problem « PHP SQL « IT news, forums, messages
Re: strip-tags problem

Posted by Danny on 01/10/06 14:18

Thanks, but i still have problems,

When i escape the htm file, i cant update it into the database: Without the
preg_replace i get it into the database. Am i doing somthing wrong=

Danny

$par = mysql_real_escape_string(file_get_contents($p1));
$rep = preg_replace("/<title>[^<]*</title>/","",$par);

$query = "UPDATE prog set datum='$datum',titel='$titel',p1='$rep' " ;



> Danny wrote:
>> Hallo, all
>>
>> I have used this function.
>> $string = strip_tags($p1,'<i><b><u><br><p><font>');
>>
>> The problem is that the title will be printed as well, but i dont allow
>> the
>> title tag.
>>
>> The intention is that people works from Word .doc domuments and saves the
>> files as html. then the html file can be inserted in the database.
>>
>> How to i exclude the <title> tag ?
>>
>
> Do you mean you want to remove the title tag as well as the text between
> the
> ending title tag?
> So you want "<title>title</title>" to be "" instead of "title"?
>
> Use a regular expression:
>
> preg_replace("/<title>[^<]*</title>/","",$text);
>
> but note if somewhere in the text is another <title>title</title> it will
> be
> removed as well.
>
> Regards
> Stefan
>
>> Thanks
>>
>> Danny
>>
>>
>>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.1rc2 (MingW32)
>
> iD8DBQFDw5vbyeCLzp/JKjARAo2hAJ9l8JQ48YdUepfJ+luelk1xN+DYyACfc1kd
> xdii1mYF0zVRI1pvdYeV49g=
> =947o
> -----END PGP SIGNATURE-----

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация