Jump to content

cannot redefine gradient()


frozenmafia

Recommended Posts

Ok so I am coding a game from a GRPG framework. And I get this error:

Fatal error: Cannot redeclare gradient() (previously declared in /home/frozen01/public_html/classeswgradients.php:759) in /home/frozen01/public_html/classeswgradients.php  on line 759.

 

Here is line 759 with the surrounding lines.

	$hexresult = mysql_query("SELECT * FROM `grpgusers` WHERE id='".$this->id."'") or die(mysql_error());
$hex = mysql_fetch_array($hexresult);
if ($hex['hexname'] == 1){
$result = mysql_query("SELECT * FROM `grpgusers` WHERE id='".$this->id."'");
$worked = mysql_fetch_array($result);
function gradient($text){
    /*** initialize the return string ***/
    $ret = '';

    /*** an array of colors ***/
    $colors = array(
        $worked['hex1'],
	$worked['hex2'],
	$worked['hex3']
	);
    /*** a counter ***/
    $i = 0;

    /*** get the length of the text ***/
    $textlength = strlen($text);

/*** a line of text ***/
    $text = $this->username;

    /*** loop over the text ***/
    while($i<=$textlength)
    {
        /*** loop through the colors ***/
        foreach($colors as $value)
        {
            if ($text[$i] != "")
            {
                $ret .= '<span style="color:#'.$value.';">'.$this->$username[$i]."</span>";
            }
        $i++;
        }
    }
    /*** return the highlighted string ***/
    return $ret;
}
}

Link to comment
https://forums.phpfreaks.com/topic/204300-cannot-redefine-gradient/
Share on other sites

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.