Jump to content

I don't even know what to call this error...


maxudaskin

Recommended Posts

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.

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>";
		}

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,

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.