faqts : Computers : Programming : Languages : PHP : Common Problems : Regular Expressions

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

12 of 21 people (57%) answered Yes
Recently 6 of 10 people (60%) answered Yes

Entry

How can i strip java script tag from php or stml script
How can we store image and word documnt file in database, Does anybody have any code

Oct 31st, 2001 11:49
Brendan, Rajendra shrestha,


use the eregi_replace function .. (it is case insensitive)
  $the_string = eregi_replace( "<javascript[^>]*>", "", $the_string ); 
- this will replace all text between the start string '<javascript' and
the next occurance of '>' with "" or nothing!
;)
Q2. (you should probably register a new question for this one) 
Images and document files are called binary large objects or 'blob's 
It will depend on your database as to how the field is setup. There is
however plenty of information and tutorials regarding specific
combinations of databases with php to allow uploading and downloading of
various blob types. 
try http://www.faqts.com/knowledge_base/view.phtml/aid/677/fid/876
on this site .. or search for blob and mysql or blob and oracle or blob
and Access etc on google ...