| | |
Remove Image
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Mar 2008
Posts: 1
Reputation:
Solved Threads: 0
Can someone give me idea on how to remove image url? For example when i click on the news link..the news information will come out..In the news information page, i only want text.I dont want to display the image. How can i figure out the image.Cause my problem is.. the new details content came from the dbase which is not in my server. I cant delete the URL manually in the server..It need alotof work.at the same time im sharing the same database with other website related.
•
•
Join Date: Nov 2007
Posts: 86
Reputation:
Solved Threads: 6
you do not need to figure out the image actually..
Rather than thinking about what html tags you do not want to allow, just think about the ones that you do want to allow.
PHP has a native function to do all of this.
Before displaying the content of your page process it using the following
Here, I told the variable $description to not have any tags other than the B P and A tags. All other tags will be stripped out.
Use this method on any and all variables which might have image tags that you do not want, but remember to add as the second argument, those tags that you do want.
Sage
Rather than thinking about what html tags you do not want to allow, just think about the ones that you do want to allow.
PHP has a native function to do all of this.
Before displaying the content of your page process it using the following
PHP Syntax (Toggle Plain Text)
<?PHP $description = strip_tags($description, '<b><p><a>'); ?>
Here, I told the variable $description to not have any tags other than the B P and A tags. All other tags will be stripped out.
Use this method on any and all variables which might have image tags that you do not want, but remember to add as the second argument, those tags that you do want.
Sage
![]() |
Similar Threads
- Having a bit of trouble figuring out my image upload script (PHP)
- Auto replace hotlinked Image Javascript? (JavaScript / DHTML / AJAX)
- Can't remove "about:blank" homepage. Please help. (Viruses, Spyware and other Nasties)
- Blaster Worm, I think, cannot remove! (Viruses, Spyware and other Nasties)
- can't remove searchpage.html trojan (Viruses, Spyware and other Nasties)
Other Threads in the PHP Forum
- Previous Thread: Popup window which queries a var
- Next Thread: How to give the variable value to textfield on same page?
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access address ajax apache api array autoincrement beginner binary broken cakephp checkbox class cms code cron curl database date dehasher directory display download dynamic echo email error external file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla limit link login loop mail menu method methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query question radio random recursion regex remote script search server sessions shopping sms soap source space speed sql structure support! syntax system table tutorial update upload url validation validator variable video web xml youtube





