Jump to content

What This Error Mean


fabs

Recommended Posts

i made a function and i use that function ten times to get several output.but just the first output successand the second till ten ouput result an error like thisFatal error: Cannot redeclare hurufa() (previously declared in /var/www/PM1 coder/proses.php:12) in /var/www/PM1 coder/proses.php on line 12anybody knows what the error above mean???

Link to comment
Share on other sites

This means that your hurufa() function already exists. You can't make more than one function with the same name. In this case you want to load the function hurufa() but there is another hurufa() function in PM1 coder/proses.php. You can do the following:-Delete one of them-Modify one of the namesGood luck

Link to comment
Share on other sites

<html><body><?php function plaintext($kata){function hurufa($kata1){$n=0;$a=0;$b=0;$c=0;$d=0;$e=0;$f=0;$g=0;$h=0;$i=0;$j=0;$k=0;$l=0;$m=0;$n=0;$o=0;$p=0;$q=0;$r=0;$s=0;$t=0;$u=0;$v=0;$w=0;$x=0;$y=0;$z=0;$kata2=str_split($kata1);for($count=0; $count<strlen($kata1) ;$count++){if(ucwords($kata2[$count])=='A') $a++;}return $a;}function hurufb($kata1){$n=0;$a=0;$b=0;$c=0;$d=0;$e=0;$f=0;$g=0;$h=0;$i=0;$j=0;$k=0;$l=0;$m=0;$n=0;$o=0;$p=0;$q=0;$r=0;$s=0;$t=0;$u=0;$v=0;$w=0;$x=0;$y=0;$z=0;$kata2=str_split($kata1);for($count=0; $count<strlen($kata1) ;$count++){if(ucwords($kata2[$count])=='B') $b++;}return $b;}function hurufc($kata1){$n=0;$a=0;$b=0;$c=0;$d=0;$e=0;$f=0;$g=0;$h=0;$i=0;$j=0;$k=0;$l=0;$m=0;$n=0;$o=0;$p=0;$q=0;$r=0;$s=0;$t=0;$u=0;$v=0;$w=0;$x=0;$y=0;$z=0;$kata2=str_split($kata1);for($count=0; $count<strlen($kata1) ;$count++){if(ucwords($kata2[$count])=='C') $c++;}return $c;}function hurufd($kata1){$n=0;$a=0;$b=0;$c=0;$d=0;$e=0;$f=0;$g=0;$h=0;$i=0;$j=0;$k=0;$l=0;$m=0;$n=0;$o=0;$p=0;$q=0;$r=0;$s=0;$t=0;$u=0;$v=0;$w=0;$x=0;$y=0;$z=0;$kata2=str_split($kata1);for($count=0; $count<strlen($kata1) ;$count++){if(ucwords($kata2[$count])=='D') $d++;}return $d;}function hurufe($kata1){$n=0;$a=0;$b=0;$c=0;$d=0;$e=0;$f=0;$g=0;$h=0;$i=0;$j=0;$k=0;$l=0;$m=0;$n=0;$o=0;$p=0;$q=0;$r=0;$s=0;$t=0;$u=0;$v=0;$w=0;$x=0;$y=0;$z=0;$kata2=str_split($kata1);for($count=0; $count<strlen($kata1) ;$count++){if(ucwords($kata2[$count])=='E') $e++;}return $e;}function huruff($kata1){$n=0;$a=0;$b=0;$c=0;$d=0;$e=0;$f=0;$g=0;$h=0;$i=0;$j=0;$k=0;$l=0;$m=0;$n=0;$o=0;$p=0;$q=0;$r=0;$s=0;$t=0;$u=0;$v=0;$w=0;$x=0;$y=0;$z=0;$kata2=str_split($kata1);for($count=0; $count<strlen($kata1) ;$count++){if(ucwords($kata2[$count])=='F') $f++;}return $f;}function hurufg($kata1){$n=0;$a=0;$b=0;$c=0;$d=0;$e=0;$f=0;$g=0;$h=0;$i=0;$j=0;$k=0;$l=0;$m=0;$n=0;$o=0;$p=0;$q=0;$r=0;$s=0;$t=0;$u=0;$v=0;$w=0;$x=0;$y=0;$z=0;$kata2=str_split($kata1);for($count=0; $count<strlen($kata1) ;$count++){if(ucwords($kata2[$count])=='G') $g++;}return $g;}function hurufh($kata1){$n=0;$a=0;$b=0;$c=0;$d=0;$e=0;$f=0;$g=0;$h=0;$i=0;$j=0;$k=0;$l=0;$m=0;$n=0;$o=0;$p=0;$q=0;$r=0;$s=0;$t=0;$u=0;$v=0;$w=0;$x=0;$y=0;$z=0;$kata2=str_split($kata1);for($count=0; $count<strlen($kata1) ;$count++){if(ucwords($kata2[$count])=='H') $h++;}return $h;}function hurufi($kata1){$n=0;$a=0;$b=0;$c=0;$d=0;$e=0;$f=0;$g=0;$h=0;$i=0;$j=0;$k=0;$l=0;$m=0;$n=0;$o=0;$p=0;$q=0;$r=0;$s=0;$t=0;$u=0;$v=0;$w=0;$x=0;$y=0;$z=0;$kata2=str_split($kata1);for($count=0; $count<strlen($kata1) ;$count++){if(ucwords($kata2[$count])=='I') $i++;}return $i;}function hurufj($kata1){$n=0;$a=0;$b=0;$c=0;$d=0;$e=0;$f=0;$g=0;$h=0;$i=0;$j=0;$k=0;$l=0;$m=0;$n=0;$o=0;$p=0;$q=0;$r=0;$s=0;$t=0;$u=0;$v=0;$w=0;$x=0;$y=0;$z=0;$kata2=str_split($kata1);for($count=0; $count<strlen($kata1) ;$count++){if(ucwords($kata2[$count])=='J') $j++;}return $j;}function hurufk($kata1){$n=0;$a=0;$b=0;$c=0;$d=0;$e=0;$f=0;$g=0;$h=0;$i=0;$j=0;$k=0;$l=0;$m=0;$n=0;$o=0;$p=0;$q=0;$r=0;$s=0;$t=0;$u=0;$v=0;$w=0;$x=0;$y=0;$z=0;$kata2=str_split($kata1);for($count=0; $count<strlen($kata1) ;$count++){if(ucwords($kata2[$count])=='K') $k++;}return $k;}function hurufl($kata1){$n=0;$a=0;$b=0;$c=0;$d=0;$e=0;$f=0;$g=0;$h=0;$i=0;$j=0;$k=0;$l=0;$m=0;$n=0;$o=0;$p=0;$q=0;$r=0;$s=0;$t=0;$u=0;$v=0;$w=0;$x=0;$y=0;$z=0;$kata2=str_split($kata1);for($count=0; $count<strlen($kata1) ;$count++){if(ucwords($kata2[$count])=='L') $l++;}return $l;}function hurufm($kata1){$n=0;$a=0;$b=0;$c=0;$d=0;$e=0;$f=0;$g=0;$h=0;$i=0;$j=0;$k=0;$l=0;$m=0;$n=0;$o=0;$p=0;$q=0;$r=0;$s=0;$t=0;$u=0;$v=0;$w=0;$x=0;$y=0;$z=0;$kata2=str_split($kata1);for($count=0; $count<strlen($kata1) ;$count++){if(ucwords($kata2[$count])=='M') $m++;}return $m;}function hurufn($kata1){$n=0;$a=0;$b=0;$c=0;$d=0;$e=0;$f=0;$g=0;$h=0;$i=0;$j=0;$k=0;$l=0;$m=0;$n=0;$o=0;$p=0;$q=0;$r=0;$s=0;$t=0;$u=0;$v=0;$w=0;$x=0;$y=0;$z=0;$kata2=str_split($kata1);for($count=0; $count<strlen($kata1) ;$count++){if(ucwords($kata2[$count])=='N') $n++;}return $n;}function hurufo($kata1){$n=0;$a=0;$b=0;$c=0;$d=0;$e=0;$f=0;$g=0;$h=0;$i=0;$j=0;$k=0;$l=0;$m=0;$n=0;$o=0;$p=0;$q=0;$r=0;$s=0;$t=0;$u=0;$v=0;$w=0;$x=0;$y=0;$z=0;$kata2=str_split($kata1);for($count=0; $count<strlen($kata1) ;$count++){if(ucwords($kata2[$count])=='O') $o++;}return $o;}function hurufp($kata1){$n=0;$a=0;$b=0;$c=0;$d=0;$e=0;$f=0;$g=0;$h=0;$i=0;$j=0;$k=0;$l=0;$m=0;$n=0;$o=0;$p=0;$q=0;$r=0;$s=0;$t=0;$u=0;$v=0;$w=0;$x=0;$y=0;$z=0;$kata2=str_split($kata1);for($count=0; $count<strlen($kata1) ;$count++){if(ucwords($kata2[$count])=='P') $p++;}return $p;}function hurufq($kata1){$n=0;$a=0;$b=0;$c=0;$d=0;$e=0;$f=0;$g=0;$h=0;$i=0;$j=0;$k=0;$l=0;$m=0;$n=0;$o=0;$p=0;$q=0;$r=0;$s=0;$t=0;$u=0;$v=0;$w=0;$x=0;$y=0;$z=0;$kata2=str_split($kata1);for($count=0; $count<strlen($kata1) ;$count++){if(ucwords($kata2[$count])=='Q') $q++;}return $q;}function hurufr($kata1){$n=0;$a=0;$b=0;$c=0;$d=0;$e=0;$f=0;$g=0;$h=0;$i=0;$j=0;$k=0;$l=0;$m=0;$n=0;$o=0;$p=0;$q=0;$r=0;$s=0;$t=0;$u=0;$v=0;$w=0;$x=0;$y=0;$z=0;$kata2=str_split($kata1);for($count=0; $count<strlen($kata1) ;$count++){if(ucwords($kata2[$count])=='R') $r++;}return $r;}function hurufs($kata1){$n=0;$a=0;$b=0;$c=0;$d=0;$e=0;$f=0;$g=0;$h=0;$i=0;$j=0;$k=0;$l=0;$m=0;$n=0;$o=0;$p=0;$q=0;$r=0;$s=0;$t=0;$u=0;$v=0;$w=0;$x=0;$y=0;$z=0;$kata2=str_split($kata1);for($count=0; $count<strlen($kata1) ;$count++){if(ucwords($kata2[$count])=='S') $s++;}return $s;}function huruft($kata1){$n=0;$a=0;$b=0;$c=0;$d=0;$e=0;$f=0;$g=0;$h=0;$i=0;$j=0;$k=0;$l=0;$m=0;$n=0;$o=0;$p=0;$q=0;$r=0;$s=0;$t=0;$u=0;$v=0;$w=0;$x=0;$y=0;$z=0;$kata2=str_split($kata1);for($count=0; $count<strlen($kata1) ;$count++){if(ucwords($kata2[$count])=='T') $t++;}return $t;}function hurufu($kata1){$n=0;$a=0;$b=0;$c=0;$d=0;$e=0;$f=0;$g=0;$h=0;$i=0;$j=0;$k=0;$l=0;$m=0;$n=0;$o=0;$p=0;$q=0;$r=0;$s=0;$t=0;$u=0;$v=0;$w=0;$x=0;$y=0;$z=0;$kata2=str_split($kata1);for($count=0; $count<strlen($kata1) ;$count++){if(ucwords($kata2[$count])=='U') $u++;}return $u;}function hurufv($kata1){$n=0;$a=0;$b=0;$c=0;$d=0;$e=0;$f=0;$g=0;$h=0;$i=0;$j=0;$k=0;$l=0;$m=0;$n=0;$o=0;$p=0;$q=0;$r=0;$s=0;$t=0;$u=0;$v=0;$w=0;$x=0;$y=0;$z=0;$kata2=str_split($kata1);for($count=0; $count<strlen($kata1) ;$count++){if(ucwords($kata2[$count])=='V') $v++;}return $v;}function hurufw($kata1){$n=0;$a=0;$b=0;$c=0;$d=0;$e=0;$f=0;$g=0;$h=0;$i=0;$j=0;$k=0;$l=0;$m=0;$n=0;$o=0;$p=0;$q=0;$r=0;$s=0;$t=0;$u=0;$v=0;$w=0;$x=0;$y=0;$z=0;$kata2=str_split($kata1);for($count=0; $count<strlen($kata1) ;$count++){if(ucwords($kata2[$count])=='W') $w++;}return $w;}function hurufx($kata1){$n=0;$a=0;$b=0;$c=0;$d=0;$e=0;$f=0;$g=0;$h=0;$i=0;$j=0;$k=0;$l=0;$m=0;$n=0;$o=0;$p=0;$q=0;$r=0;$s=0;$t=0;$u=0;$v=0;$w=0;$x=0;$y=0;$z=0;$kata2=str_split($kata1);for($count=0; $count<strlen($kata1) ;$count++){if(ucwords($kata2[$count])=='X') $x++;}return $x;}function hurufy($kata1){$n=0;$a=0;$b=0;$c=0;$d=0;$e=0;$f=0;$g=0;$h=0;$i=0;$j=0;$k=0;$l=0;$m=0;$n=0;$o=0;$p=0;$q=0;$r=0;$s=0;$t=0;$u=0;$v=0;$w=0;$x=0;$y=0;$z=0;$kata2=str_split($kata1);for($count=0; $count<strlen($kata1) ;$count++){if(ucwords($kata2[$count])=='Y') $y++;}return $y;}function hurufz($kata1){$n=0;$a=0;$b=0;$c=0;$d=0;$e=0;$f=0;$g=0;$h=0;$i=0;$j=0;$k=0;$l=0;$m=0;$n=0;$o=0;$p=0;$q=0;$r=0;$s=0;$t=0;$u=0;$v=0;$w=0;$x=0;$y=0;$z=0;$kata2=str_split($kata1);for($count=0; $count<strlen($kata1) ;$count++){if(ucwords($kata2[$count])=='Z') $z++;}return $z;} $panjangk=strlen($kata); $a=hurufa($kata); $b=hurufb($kata); $c=hurufc($kata); $d=hurufd($kata); $e=hurufe($kata); $f=huruff($kata); $g=hurufg($kata); $h=hurufh($kata); $i=hurufi($kata); $j=hurufj($kata); $k=hurufk($kata); $l=hurufl($kata); $m=hurufm($kata); $n=hurufn($kata); $o=hurufo($kata); $p=hurufp($kata); $q=hurufq($kata); $r=hurufr($kata); $s=hurufs($kata); $t=huruft($kata); $u=hurufu($kata); $v=hurufv($kata); $w=hurufw($kata); $x=hurufx($kata); $y=hurufy($kata); $z=hurufz($kata);$file = fopen("pass.txt", "r") or exit("Unable to open file!");//Output a line of the file until the end is reachedwhile(!feof($file)) { $pass=fgets($file);$panjangp=strlen($pass); $a1=hurufa($pass); $b1=hurufb($pass); $c1=hurufc($pass); $d1=hurufd($pass); $e1=hurufe($pass); $f1=huruff($pass); $g1=hurufg($pass); $h1=hurufh($pass); $i1=hurufi($pass); $j1=hurufj($pass); $k1=hurufk($pass); $l1=hurufl($pass); $m1=hurufm($pass); $n1=hurufn($pass); $o1=hurufo($pass); $p1=hurufp($pass); $q1=hurufq($pass); $r1=hurufr($pass); $s1=hurufs($pass); $t1=huruft($pass); $u1=hurufu($pass); $v1=hurufv($pass); $w1=hurufw($pass); $x1=hurufx($pass); $y1=hurufy($pass); $z1=hurufz($pass); if( ($a==$a1) && ($b==$b1) && ($c==$c1)&& ($d==$d1)&& ($e==$e1)&& ($f==$f1)&& ($g==$g1)&& ($h==$h1)&& ($i==$i1)&& ($j==$j1)&& ($k==$k1)&& ($l==$l1)&& ($m==$m1)&& ($n==$n1)&& ($o==$o1)&& ($p==$p1)&& ($q==$q1)&& ($r==$r1)&& ($s==$s1)&& ($t==$t1)&& ($u==$u1)&& ($v==$v1)&& ($w==$w1)&& ($x==$x1)&& ($y==$y1)&& ($z==$z1)){echo $pass;break;}}fclose($file); }$kata0=$_POST["kata"];$katax=$_POST["kataa"];$katab=$_POST["katab"];$katac=$_POST["katac"];$katad=$_POST["katad"];$katae=$_POST["katae"];$kataf=$_POST["kataf"];$katag=$_POST["katag"];$katah=$_POST["katah"];$katai=$_POST["katai"];plaintext($kata0);plaintext($katax);?></body></html>
above is the source code of proses.php i did not declare hurufa() more than one times. hurufa() just nested in plaintext() function.and i use plaintext() at the end of the source more than one time.and it result an error.
Link to comment
Share on other sites

You declare hurufa() inside the plaintext() function. So every time you call plaintext() you are trying to create a new function named hurufa(). Move hurufa() outside the plaintext() function and just call it from within plaintext().

Link to comment
Share on other sites

Yeesh!You do realise that rather than creating this mass amount of functions you could just have one and pass the letter?

function huruf($kata, $letter){	// the line you had here is superfluous, within the function	// those variables are out of "scope" and technically don't exist	$count = 0;	foreach (str_split($kata) as $char)	{		if (strtoupper($char) == strtoupper($letter))		{			$count++;		}	}	return $count;}$a = huruf($kata, 'a');$b = huruf($kata, 'b');//...

For more information on variable scope read here: http://php.net/manual/en/language.variables.scope.phpHope this helps,Adam

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...