TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 03-05-2011, 02:06 PM   #1 (permalink)
The Contributor
 
Tim Dobson's Avatar
 
Join Date: Feb 2010
Posts: 69
Thanks: 16
Tim Dobson is on a distinguished road
Default Str _replace Issue

Hey guys i have been trying to get the hang of the str_replace only have a little issue

i can have
PHP Code:
$thescripttemps str_replace("<wordfilter>","&lt;wordfilter>",$thescripttemps); 
Now that works andit will replace them with no issue, the issue i have is that $thescripttemps contains </wordfilter> and turns it in to &lt;wordfilter aswell which i do not want. Any suggestions? Thanks!
Tim Dobson is offline  
Reply With Quote
Old 03-05-2011, 05:16 PM   #2 (permalink)
The Addict
 
tony's Avatar
 
Join Date: Aug 2008
Posts: 336
Thanks: 8
tony is on a distinguished road
Default

I try that with this example
php Code:
echo str_replace("<wordfilter>","&lt;wordfilter>","<wordfilter>hwekljo </wordfilter>");
//returns: &lt;wordfilter>hwekljo </wordfilter>
 
I don't see a problem, maybe with the $thescripttemps?
tony is offline  
Reply With Quote
The Following User Says Thank You to tony For This Useful Post:
Tim Dobson (03-05-2011)
Old 03-05-2011, 06:29 PM   #3 (permalink)
The Contributor
 
Tim Dobson's Avatar
 
Join Date: Feb 2010
Posts: 69
Thanks: 16
Tim Dobson is on a distinguished road
Default

Yes you was correct. Lucky you said that because i was on the verge of a give up thanks again. Simple mistakes have such a big impact on these scripts!
Tim Dobson is offline  
Reply With Quote
Reply



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

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Template Class Issue tego10122 Advanced PHP Programming 1 12-28-2010 07:08 PM
Date parsing issue Enfernikus Javascript, AJAX, E4X 1 08-11-2009 01:29 PM
Frustrating PNG Issue on IE 6 aristoworks XHTML, HTML, CSS 5 11-10-2008 08:18 AM
Session / Cookie Issue? dav Feedback 3 12-30-2007 07:57 PM
PHP / MySQL issue maZtah General 5 10-24-2007 04:00 PM


All times are GMT. The time now is 11:02 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design