I need Help I am doing this project that has publications that I want to have displayed from selecting the month and the year published and using the header command redirect them to the proper PDF. Below is the code and the link is where its located.
http://dev.elinkdesign.com/active/aaep.org/guardian_index.php
CODED START
$dbGUARDIAN = mysql_connect($db_host, $db_user, $db_pass) or die("ERROR: Could not connect to backend database.");
mysql_select_db($db_name) or die("ERROR: Could not select database.");
$qGUARDIAN = mysql_query("SELECT publication_id, pdf_file FROM publication WHERE year='$year' AND month='$month'") or die("ERROR: Could not query backend database.");
$num_guardian = mysql_num_rows($qGUARDIAN);
if ($num_guardian == 0) {
header("Location: guardian_index.php");
}else{
list($publication_id, $pdf_file) = mysql_fetch_row($qGUARDIAN);
$issue_path = $guardian_path.$pdf_file;
header("Content-type: application/octet-stream");
header("Location: [url]http://[/url]".$SERVER['HTTP_HOST'].dirname($SERVER['PHP_SELF'])."/".$issue_path);
exit;
}
CODE STOP