User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 373,936 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,612 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 363 | Replies: 1
Reply
Join Date: Mar 2008
Posts: 1
Reputation: miss_bismillah is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
miss_bismillah miss_bismillah is offline Offline
Newbie Poster

Remove Image

  #1  
Mar 27th, 2008
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.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Nov 2007
Posts: 86
Reputation: sagedavis is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 6
sagedavis sagedavis is offline Offline
Junior Poster in Training

Re: Remove Image

  #2  
Mar 27th, 2008
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
<?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
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb PHP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 6:32 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC