ValidateLogin('none', 'login.html', '®=cofa'); if (isset($_GET['pname']) && isset($_GET['lotn'])) { $pname = $_GET['pname']; $lotn = $_GET['lotn']; // $is = strpos($pname, "("); // $ie = strpos($pname, ")"); // $name = substr($pname, $is + 1, $ie - $is - 1) .'-'. $lotn .'.pdf'; $name = $pname .'-'. $lotn .'.pdf'; $file = '/home/forttest/public_html/cofa/' . $name; if (file_exists($file)) { echo '1'; $query = "INSERT INTO fb_downloads_cofa (user_id, pdf) VALUES ($userid, '$name');"; $result = mysql_query($query, $link); } else { echo '0'; } echo $file; exit(); } ?>