[SRILM User List] srilm download fail

Xingyu Na asr.naxingyu at gmail.com
Sun Jan 8 21:02:48 PST 2017


Hi,

I filled in the download form and clicked the accept button. Then I was redirected to a php page with only some php code like this:
===================
$value) { $new_array["$key"] = strip_tags($value); } return $new_array; } function reclog($logfile) { global $newpost; date_default_timezone_set('America/Los_Angeles'); $fecha = date(DATE_RFC2822); $remote_addr = $_SERVER['REMOTE_ADDR']; // REMOTE_HOST is undefined index in current Apache2 server // $remote_host = $_SERVER['REMOTE_HOST'] ?: gethostbyaddr($remote_addr); $remote_host = gethostbyaddr($remote_addr); $fh = fopen("$logfile", 'a+'); fwrite($fh, "$fecha\n"); fwrite($fh, "From_Addr=$remote_addr\n"); fwrite($fh, "From_Host=$remote_host\n"); fwrite($fh, "Name=" . $newpost['WWW_name'] . "\n"); fwrite($fh, "Org=" . $newpost['WWW_org'] . "\n"); fwrite($fh, "Address=" . $newpost['WWW_address'] . "\n"); fwrite($fh, "Email=" . $newpost['WWW_email'] . "\n"); fwrite($fh, "URL=" . $newpost['WWW_url'] . "\n"); fwrite($fh, "File=" . $newpost['WWW_file'] . "\n"); if (!isset($newpost['WWW_list'])) $newpost['WWW_list'] = ""; fwrite($fh, "List=" . $newpost['WWW_list'] . "\n\n"); fclose($fh); } function recemail($maillist) { global $newpost; $email = preg_replace('/\s+/', ' ', $newpost['WWW_email']); $fh = fopen("$maillist", 'a+'); fwrite($fh, $newpost['WWW_name'] . " <$email>\n"); fclose($fh); } function download($file) { if (file_exists($file)) { header('Content-Description: File Transfer'); header('Content-Type: application/gzip'); header('Content-Disposition: attachment; filename='.basename($file)); header('Expires: 0'); header('Cache-Control: must-revalidate'); header('Pragma: public'); header('Content-Length: ' . filesize($file)); readfile($file); exit; } else { header("Content-type: text/plain\n"); header("Status: 404 Not Found\n"); print "$file not found!\n"; } } /**** MAIN ****/ // clean input values $newpost = strip_html_in_array($_POST); // check for proper form entry if (empty($newpost['WWW_name']) || empty($newpost['WWW_email'])) { if (!empty($newpost['WWW_signup'])) { // for sign-up print "Your Name or Email are missing.
"; print "Please go back and complete the form.

"; exit(0); } else if (empty($newpost['WWW_address'])) { // for download print "Your Name, Address or Email are missing.

"; print "Please go back and complete the form.

"; exit(0); } } /* DEBUGGING print "Send result:

"; print "

";
print_r($_POST);
print_r($newpost);
print "
"; exit (0); */ if (!isset($newpost['WWW_list'])) { recemail($maillist_announce); } else if (isset($newpost['WWW_signup'])) { recemail($maillist_users); } if (isset($newpost['WWW_signup'])) { header('Content-Description: Display signup successfully done'); header('Content-Type: text/html'); header('Expires: 0'); header('Cache-Control: must-revalidate'); header('Pragma: public'); print "
"; print ""; print "
"; print ""; print ""; exit(0); } else { // not signup so it's download reclog($logfile); download("$datadir/" . $newpost['WWW_file']); } ?>
===================

I tried safari and chrome. Anyone could help? Thanks!

Xingyu

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.speech.sri.com/pipermail/srilm-user/attachments/20170109/c66b03cd/attachment.html>


More information about the SRILM-User mailing list