Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.