i need to fix a code ..

[php]<?php

$s2 = rainbow($_POST[“cmd”]); //here is my problem…
print(“text”); //here is my problem…

function rainbow($s)
{
$s = decolorize($s);
$s2 = “”;

$n = mb_strlen($s);
$j = ((6 * max(1, floor($n/$CONSTANT + rand() / getrandmax() * 2 - 1))) / $n) * (1 - 2 * (rand(0, 1)));
$f = rand() / getrandmax() * 6;
$p = 0;

for($i = 0; $i < $n; ++$i)
{
$c = mb_substr($s, $i, 1);
if($c == “^”)
{
$c = “^^”;
if(mb_substr($s, $i+1, 1) == “^”)
++$i;
}
if($c != " ")
{
list($r, $g, $b) = array($j, $j, $j);
$c = rgb_to_hexcolor($r, $g, $b) . $c;
}
++$p;
$s2 .= $c;
}

return $s2;
}
?>[/php]

and thats waht i need

That code was just a PHP function - you still need to call it.

The code is supposed to print the console commands to run.

It gets input from $_POST[‘cmd’] and $_POST[‘text’].

does $s2 hold a value

try echo $s2 or print $2

also noticed you have print(“text”); which is not declared

Can we have the source for decolorize so we can see the error, please?

i need the $_POST[‘cmd’] and $_POST[‘text’].
command for my alias
alias rcolor1 “menu_cmd curl --exec http://example.com/rcolor1 text “$1” text “${2- q}””

the source …
i got error like
<style…

… error

i fixed the code

Closed.

Sponsor our Newsletter | Privacy Policy | Terms of Service