Hi all, I am trying to figure out a way if its possible to create a php script which searches a database and returns information as well as file paths. output is returned in a list and I would like the file paths to be returned as hyperlinks which when clicked open the corresponding PDF document. Is this possible? Here is what i have so far
<?php
include "include_fns.php";
include "header.php";
$conn = db_connect();
$pages_sql = "select * from pages order by code";
$pages_result = mysql_query($pages_sql, $conn);
while ($pages = mysql_fetch_array($pages_result)) {
$story_sql = "select * from stories
where page = '$pages
'
and published is not null
order by published desc";
$story_result = mysql_query($story_sql, $conn);
if (mysql_num_rows($story_result)) {
$story = mysql_fetch_array($story_result);
print "<TABLE BORDER=0 WIDTH=400>";
print "<TR>";
print "<TD ROWSPAN=2 WIDTH=100>";
if ($story[picture])
print "<IMG SRC=\"resize_image.php?image=$story[picture]\">";
print "</TD>";
print "<TD>";
print "<H3>$pages[description]</H3>";
print $story[headline];
print "</TD>";
print "</TR>";
print "<TR><TD ALIGN=RIGHT>";
print "<A HREF=\"page.php?page=$pages[code]\">";
print "<FONT SIZE=1>Read more $pages[code] ...</FONT>";
print "</A>";
print "</TABLE>";
}
}
?>
I tried adding headers and functions to open pdf documents it just seemed to return standard output of the pdf