{$_SERVER['HTTP_REFERER']} cannot be found";
exit();
}
// main() ********************************
$hompa['coodir']="../../private/"; # get_home_paths();
$my_cnf=parse_ini_file("{$hompa['coodir']}my.cnf");
if (!isset($_SERVER['HTTP_REFERER'])) {
header("HTTP/1.1 400 Bad request");
echo "\$_SERVER['HTTP_REFERER'] must be defined
\n";
exit();
}
$parm= $scrip= "";
$dscr = substr($_SERVER['HTTP_REFERER'],strpos($_SERVER['HTTP_REFERER'],'/',10));
if (($j=strpos($dscr,'?'))!=0) { $parm=substr($dscr,$j+1); $dscr=substr($dscr,0,$j); }
# $dscr - directory and script name
sel_db('log');
$msq="INSERT INTO `callomyby` ".
"(`datim`,`ipaddr`,`pagename`,`params`,`browser`) VALUES ".
"(now(),'{$_SERVER['REMOTE_ADDR']}','$dscr','$parm','".
addslashes($_SERVER['HTTP_USER_AGENT']) ."')" ;
$insres= ( mysql_query($msq) ? '' : mysql_error() );
# echo 'insres = '. $insres .'
/n';
if (($j=strpos($dscr,'/',1))!=0) { $res=substr($dscr,0,$j); $scrip=substr($dscr,$j); }
else $res=$dscr;
# echo "$res | $scrip
\n";
if (($fixrow=do_query($dscr))==FALSE) { $fixrow=do_query($res); }
# first try whole directory and script name, which failing try directory name
if ($fixrow) {
# echo "Found {$fixrow['fixtype']}";
switch ($fixrow['fixtype']) {
case 1: # Invalid script name in known directory name
default: do_404();
break;
case 2: # Known script name in home directory
header("HTTP/1.1 400 Bad request");
echo "