Hi Kudose,
I have modified ur code please copy and test it on ur server. Hope this will help u.
<title>Spechal.com Presents .::UBB Color Designer::.</title>
<?
if(isset($POST['submit'])){
//gather posted info and split it up
$post = $POST['post'];
$option = $_POST['option'];
$post = strip_tags($post);
$post = stripslashes($post);
//check to see if they are trying to flod server
if($post>chr(1000)){ echo "Post is too big. Try again"; exit(); }
if($option == "word"){
$arr = explode(" ", $post);
$num = count($arr);
//start for statement, making a random color each pass and editing the post variable
for($i=0; $i<$num; $i++){
//$color = array("0"=>$black, "1"=>$red, "2"=>$blue, "3"=>$purple, "4"=>$gray, "5"=>$orange, "6"=>$green);
//start switch
switch($color){
case "0":
$s = "";
$e = " ";
break;
case "1":
$s = "[red]";
$e = "[/red] ";
break;
case "2":
$s = "[blue]";
$e = "[/blue] ";
break;
case "3":
$s = "[purple]";
$e = "[/purple] ";
break;
case "4":
$s = "[gray]";
$e = "[/gray] ";
break;
case "5":
$s = "[orange]";
$e = "[/orange] ";
break;
case "6":
$s = "[green]";
$e = "[/green] ";
break;
}
//end switch
$glue = $s.$arr[$i].$e;
$arr[$i] = $glue;
} //end for statement
//end cutting and pasting
//begin displaying
echo "<h1>Copy and paste</h1><br>";
for($q=0; $q<$num; $q++){
echo $arr[$q];
}
echo "<center><br><br>©2004 Spechal Developments<br><a href=\"http://www.spechal.com\" target=\"_blank\">www.spechal.com</a></center>";
} else {
//create str_replace function since it is only in PHP 5
if(!function_exists('str_split')) {
function str_split($string) {
$chars = array();
for($i=0;$i<strlen($string);$i++) {
$chars[] = $string{$i};
}
return $chars;
}
}
$arr = str_split($post);
$num = count($arr);
//start for statement, making a random color each pass and editing the post variable
for($i=0; $i<$num; $i++){
//$color = array("0"=>$black, "1"=>$red, "2"=>$blue, "3"=>$purple, "4"=>$gray, "5"=>$orange, "6"=>$green);
//start switch
switch($color){
case "0":
$s = "";
$e = "";
break;
case "1":
$s = "[red]";
$e = "[/red]";
break;
case "2":
$s = "[blue]";
$e = "[/blue]";
break;
case "3":
$s = "[purple]";
$e = "[/purple]";
break;
case "4":
$s = "[gray]";
$e = "[/gray]";
break;
case "5":
$s = "[orange]";
$e = "[/orange]";
break;
case "6":
$s = "[green]";
$e = "[/green]";
break;
}
//end switch
$glue = $s.$arr[$i].$e;
$arr[$i] = $glue;
} //end for statement
//end cutting and pasting
//begin displaying
echo "<h1>Copy and paste</h1><br>";
for($q=0; $q<$num; $q++){
echo $arr[$q];
}
echo "<center><br><br>©2004 Spechal Developments<br><a href=\"http://www.spechal.com\" target=\"_blank\">www.spechal.com</a></center>";
//end split of words and characters
} } else {
// start form
echo "<form action='$PHP_SELF' method='POST'><center><h3>Please remember that this script is in testing mode.<br>";
echo "Do not try to use links or anything special. Currently does not support [enter] keystrokes. This will be worked on more.<br>";
echo "Thus far I have only worked on it for about 20 minutes.<br>";
echo "Send comments and suggestions <a href='mailto:webmaster@spechal.com' style=text-decoration:none>here</a><br>Enter your text below.</h3><br>";
echo "<textarea name='post' rows='5' cols='40'></textarea><br>";
echo "<input type='radio' name='option' value='word' checked>Color By Word <input type='radio' name='option' value='letter'>Color By Letter<br>";
echo "<input type='radio' name='color' value='0'>Black <input type='radio' name='color' value='1'>Red <input type='radio' name='color' value='2'>Blue<br> ";
echo "<input type='radio' name='color' value='3'>Purple <input type='radio' name='color' value='4'>Gray <input type='radio' name='color' value='5'>Orange<br> ";
echo "<input type='radio' name='color' value='6'>Green ";
echo "<input type='submit' name='submit' value='Submit'></center></form>";
echo "<center><br><br>©2004 Spechal Developments<br><a href=\"http://www.spechal.com\" target=\"_blank\">www.spechal.com</a></center>";
}
?>
Thanks
Shailesh