php - Checksum Failure -
i've got script , produces following error: 001 checksum failure
this script, don't know what's wrong it, me?
<?php /* access control targetpay pay per use (c) targetmedia 2007 upload file in protected directory , make sure .htaccess support enabled. modifications in code allowed not supported product-id: 28717 generated: 16-01-2011 14:57:05 */ define ("checksum", "739b54dc26"); define ("err001", "001 checksum failure"); define ("err002", "002 can't open .htaccess writing. check rights."); define ("err003", "003 i/o error, cannot write .htaccess. disk full?"); list($thispage) = explode("?", "http://".$_server["http_host"].$_server["request_uri"]); $payscreen = "http://www.targetpay.nl/send/?id=28717&rtlo=51090". "&pm=".urlencode("inline=1"). "&ref=".urlencode($thispage); header ("content-type: text/plain"); if ($_get["checksum"] != checksum) { die (err001); } function ip2hex ($ip) { list ($a,$b,$c,$d) = explode(".", $ip); return str_pad(dechex($a),2,"0",str_pad_left). str_pad(dechex($b),2,"0",str_pad_left). str_pad(dechex($c),2,"0",str_pad_left). str_pad(dechex($d),2,"0",str_pad_left); } function hex2ip ($hex) { return hexdec(substr($hex,0,2)).".". hexdec(substr($hex,2,2)).".". hexdec(substr($hex,4,2)).".". hexdec(substr($hex,6,2)); } function parse ($whitelist, $payscreen) { $here = substr($_server["script_filename"], strrpos ($_server["script_filename"], "/") + 1); $o = "errordocument 403 $payscreen\n". "<files .htaccess>\n". "order allow,deny\n". "deny all\n". "</files>\n". "<files $here>\n". "order allow,deny\n". "allow all\n". "</files>\n". "order deny,allow\n". "deny all\n"; if ((!$whitelist) || ($whitelist=="empty")) { return $o; } $iplist = explode(",", $whitelist); foreach ($iplist $hex) { $ip = hex2ip ($hex); if ($ip) { $o .= "allow $ip\n"; } } return $o; } if ($_get["register"]) { $fp = @fopen(".htaccess", "w+"); if (!$fp) { die (err002); } if (!@fwrite ($fp, parse($_get["register"],$payscreen))) { die (err003); } @fclose ($fp); echo "000 ok"; } if ($_get["reset"]) { @unlink (".htaccess"); $fp = @fopen(".htaccess", "w+"); if (!$fp) { die (err002); } if (!@fwrite ($fp, parse("",$payscreen))) { die (err003); } @fclose ($fp); echo "000 reset ok"; } if ($_get["dump"]) { echo @implode("",file(".htaccess")); echo "\n-eof-"; } ?>
many thanks!
i dont think error. actually
if($_get["checksum"] != checksum) { die (err001); }
this condition getting true, output not error. check data wherever getting initially.its not programmatic error sure.
Comments
Post a Comment