$file = fopen("flat.txt","a+");
$contents = fread($file, filesize("flat.txt"));
$_POST[tag] = str_replace("B)","<img src='http://www.ramptstudios.com/uber/smileys/cool.gif'>",$_POST[tag]);
fclose($file);
Why isn't this code working to make smileys on <!-- m --><a class="postlink" href="http://www.uberboard.uni.cc">http://www.uberboard.uni.cc</a><!-- m -->
?
It's supposed to display this: <!-- m --><a class="postlink" href="http://www.ramptstudios.com/uber/smileys/cool.gif">http://www.ramptstudios.com/uber/smileys/cool.gif</a><!-- m -->
when some one posts: B)
But it won't workwell, for starters, you arent writing the str_replaced string to it, or you arent str_replacing the contents, whatever you are doing.What? I dont get itthe snippet you posted doesnt really show anything. what is $_POST[tag] (probably should be $_POST['tag'])? if you want to do the str_replace on the contents that you read in it should be $contents = str_replace(... , $contents);
$contents = fread($file, filesize("flat.txt"));
$_POST[tag] = str_replace("B)","<img src='http://www.ramptstudios.com/uber/smileys/cool.gif'>",$_POST[tag]);
fclose($file);
Why isn't this code working to make smileys on <!-- m --><a class="postlink" href="http://www.uberboard.uni.cc">http://www.uberboard.uni.cc</a><!-- m -->
?
It's supposed to display this: <!-- m --><a class="postlink" href="http://www.ramptstudios.com/uber/smileys/cool.gif">http://www.ramptstudios.com/uber/smileys/cool.gif</a><!-- m -->
when some one posts: B)
But it won't workwell, for starters, you arent writing the str_replaced string to it, or you arent str_replacing the contents, whatever you are doing.What? I dont get itthe snippet you posted doesnt really show anything. what is $_POST[tag] (probably should be $_POST['tag'])? if you want to do the str_replace on the contents that you read in it should be $contents = str_replace(... , $contents);