maxudaskin Posted March 9, 2008 Share Posted March 9, 2008 I have a script that will change [img ]http:// to <img src=' and [/ img] to ' /> but whenever I use it, it shows this: and the insert text is: http://www.virtualzoom.net/images/TOPLOGO.gif[/ img] Quote Link to comment https://forums.phpfreaks.com/topic/95144-i-dont-even-know-what-to-call-this-error/ Share on other sites More sharing options...
AndyB Posted March 9, 2008 Share Posted March 9, 2008 I don't even know what to call this error... I'd call it one or more errors in your script. Quote Link to comment https://forums.phpfreaks.com/topic/95144-i-dont-even-know-what-to-call-this-error/#findComment-487355 Share on other sites More sharing options...
maxudaskin Posted March 9, 2008 Author Share Posted March 9, 2008 what'd you do? Quote Link to comment https://forums.phpfreaks.com/topic/95144-i-dont-even-know-what-to-call-this-error/#findComment-487358 Share on other sites More sharing options...
peranha Posted March 9, 2008 Share Posted March 9, 2008 From what you image looks like there is a / in front of www Quote Link to comment https://forums.phpfreaks.com/topic/95144-i-dont-even-know-what-to-call-this-error/#findComment-487361 Share on other sites More sharing options...
maxudaskin Posted March 9, 2008 Author Share Posted March 9, 2008 it is removing the http:/ and leaving one of the forward slashes... (http://) Quote Link to comment https://forums.phpfreaks.com/topic/95144-i-dont-even-know-what-to-call-this-error/#findComment-487368 Share on other sites More sharing options...
AndyB Posted March 9, 2008 Share Posted March 9, 2008 If you want to play games, do it somewhere else. If you want to ask for help with what is obviously a flaw in your code, then either ask elsewhere or post enough code that an interested person could see what it is you're trying to do to what and how. If your next post doesn't provide useful information, this thread will be locked. Quote Link to comment https://forums.phpfreaks.com/topic/95144-i-dont-even-know-what-to-call-this-error/#findComment-487372 Share on other sites More sharing options...
maxudaskin Posted March 9, 2008 Author Share Posted March 9, 2008 Ouch... a little harsh... here is the code... $_POST['text'] is the image thing posted in the first post. <?php /* constants */ $smilies = array("[img=","]","","","","",":/",":smile:",":sad:",":happy:","",":peace:",":argue:",":rockband:",":hithead:",":hitheadexplode:",":beer:",":pop:",":box:",":boxing:",":dissolve:",":chairtohead:",":clap:",":needle:",":cheers:",":snackbowl:",":fishslap:",":toughguy:",":laugh:",":friends:",":coke:",":knight:",":cellphone:",":pepsi:",":prankcall:",":picture:",":moreandmore:",":poke:",":mad:",":rage:",":cyborg:",":lostwings:",":pacing:",":singtodevil:",":bound:",":smoke:",":no:",":censored:"); $locations = array('<img src=\"','\" />',"<img src='../comm/smilies/smile.gif' />","<img src='../comm/smilies/sad.gif' />","<img src='../comm/smilies/biggrin.gif' />","<img src='../comm/smilies/tongue.gif' />","<img src='../comm/smilies/unsure.gif' />","<img src='../comm/smilies/smile.gif' />","<img src='../comm/smilies/sad.gif' />","<img src='../comm/smilies/biggrin.gif' />","<img src='../comm/smilies/confused.gif' />","<img src='../comm/smilies/signs/peace.gif' />","<img src='../comm/smilies/3.gif' />","<img src='../comm/smilies/5.gif' />","<img src='../comm/smilies/6.gif' />","<img src='../comm/smilies/7.gif' />","<img src='../comm/smilies/8.gif' />","<img src='../comm/smilies/9.gif' />","<img src='../comm/smilies/10.gif' />","<img src='../comm/smilies/11.gif' />","<img src='../comm/smilies/12.gif' />","<img src='../comm/smilies/13.gif' />","<img src='../comm/smilies/14.gif' />","<img src='../comm/smilies/16.gif' />","<img src='../comm/smilies/17.gif' />","<img src='../comm/smilies/18.gif' />","<img src='../comm/smilies/19.gif' />","<img src='../comm/smilies/20.gif' />","<img src='../comm/smilies/21.gif' />","<img src='../comm/smilies/22.gif' />","<img src='../comm/smilies/23.gif' />","<img src='../comm/smilies/24.gif' />","<img src='../comm/smilies/25.gif' />","<img src='../comm/smilies/26.gif' />","<img src='../comm/smilies/27.gif' />","<img src='../comm/smilies/28.gif' />","<img src='../comm/smilies/29.gif' />","<img src='../comm/smilies/30.gif' />","<img src='../comm/smilies/31.gif' />","<img src='../comm/smilies/32.gif' />","<img src='../comm/smilies/34.gif' />","<img src='../comm/smilies/35.gif' />","<img src='../comm/smilies/36.gif' />","<img src='../comm/smilies/37.gif' />","<img src='../comm/smilies/38.gif' />","<img src='../comm/smilies/39.gif' />","<img src='../comm/smilies/no.gif' />","<img src='../comm/smilies/censored.gif' />"); /* Code */ if(!empty($_GET['p'])){ if($_GET['p'] == "post"){ if($_POST['submit'] == "Preview"){ $subject = $_POST['subject']; $text = $_POST['message']; $type = $_POST['type']; echo "<table style=\"border-top:1px #FFFFFF solid\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"; echo "<tr><td height=\"20\" colspan=\"2\" bgcolor=\"#333355\"><span class=\"style26\"> ".$subject."</span></td></tr><tr>"; echo "<td width=\"17%\" rowspan=\"3\" valign=\"top\" nowrap=\"nowrap\" bgcolor=\"#EFF4FB\" style=\"border-bottom:1px #333355 solid; border-right: 1px #333355 solid; padding-left:5px;\"><br />OOM".$pid."<br />".$name."<br /><br />".$hours." Hours<br />".$rank."<br />".$position."<br /><br /><br /></td>"; echo "<td width=\"83%\" height=\"15\" valign=\"top\" bgcolor=\"#F6F6F6\" style=\"padding-left:5px\">"; echo "<em>Posted on ".$date." at ".$time."</em></td></tr>"; echo "<tr><td valign=\"top\" style=\"padding-left:5px; padding-top:3px;\" bgcolor=\"#FFFFFF\"> ".str_replace($smilies,$locations,$text)."</td></tr><tr><td height=\"39\" bgcolor=\"#FFFFFF\" style=\"border-bottom:1px #333355 solid; padding-left:5px;\">Signature </td></tr></table>"; } Quote Link to comment https://forums.phpfreaks.com/topic/95144-i-dont-even-know-what-to-call-this-error/#findComment-487394 Share on other sites More sharing options...
maxudaskin Posted March 9, 2008 Author Share Posted March 9, 2008 SOLVED Quote Link to comment https://forums.phpfreaks.com/topic/95144-i-dont-even-know-what-to-call-this-error/#findComment-487422 Share on other sites More sharing options...
uniflare Posted March 9, 2008 Share Posted March 9, 2008 it could help us a little if you post the html source of the output you recieve. seperate bbc code from bbc code tags. eg 2 arrays (replace value and replacement value) for smilies and 2 for bbc tags like and etc. then use preg_replace instead of str_replace, (just make sure the replace values are valid REGEX patterns. note: with preg match you could use bbc tags like This URL if you know what i mean. hope this helps, Quote Link to comment https://forums.phpfreaks.com/topic/95144-i-dont-even-know-what-to-call-this-error/#findComment-487426 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.