Gossamer Forum
Home : General : Perl Programming :

Bad name after...

Quote Reply
Bad name after...
Hi...can anyone see why this code would give an error;

Code:
sub valid
{
my($a,$b,$c,$h,$i,$l,$q,$w,$x,$y,$z,@s,@v);

$a=$secret;

$q='&'.substr($ENV{'QUERY_STRING'},0,256);
$q=~/\Wseed=(\w+)/; $b=$1;
$q=~/\Wcbpop=(\w+)/; $c=$1;

return 0 unless $a&&$b&&$c;

$h=0x80000000; $l=0x7fffffff;
$q=''; $w=uc "$a $b"; $x=$y=$z=17;
@v=unpack("C*",$w); $n=1+$#v;
for($i=0;$i<256;$i++)
{ $w=(($x&$l)+($y&$l))^(($x^$y)&$h);
$w=($w<<$z)|($w>>(32-$z));
$w=(($w&$l)+$v[$i%$n])^($w&$h);
$s[$i&7]+=$w&31; $z=$y&31; $y=$x; $x=$w;
}

for ($i=0;$i<8;$i++)
{ $q.=substr('0123456789BCDEFGHJKLMNPQRSTVWXYZ',$s[$i]&31,1); }

return $c eq $q;
}
# end the 'valied' sub

The error is;

Quote:
Software error:
Bad name after QUERY_STRING' at
/usr/local/etc/httpd/htdocs/nikoleskicom/cgi-bin/buy.cgi line 121.

This code works fine on some servers, yet not on this one Unsure Could it be a modules/version problem?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!