Hey guys, I'm using dlguard to protect my download page. I copied and pasted the code it generated and I received this error: Fatal error: Cannot redeclare cbvalid() (previously declared in /home/valandil/public_html/cbthankyou.php:13) in /home/valandil/public_html/dlguard/cbcode.php on line 135 Code (markup): Line 128 - 135 of cbcode.php is $q[8] = "\0"; $finalstring = ""; for($i=0;$i < 8;$i++) $finalstring .= $q[$i]; if (!strcmp($cbpop, $finalstring)) return 1; else return 0; } Code (markup): Anyone help? Thanks.
It looks like the function is being declared twice on one of the files used. Check your file cbthankyou.php for where the function cbvalid() is being declared. Removing one of them should fix your problem.
What if both scripts I'm using needed that function. I checked that, yes, cbthankyou.php do have a cbvalid() function but it's part of the script. The new script I want to use also has that...
Well thats your error. You are going to have to find some way to remove one of them otherwise it won't work.
surround you function in if sentence : if (!function_exists('cbvalid')) { function cbvalid () { /* function code */ } } PHP:
Chances are the function is redeclared in a loop, so renaming would stop the function being called altogether. Can't see how a class would solve the problem. Do as kreoton suggested and use function_exists. Jay