I am getting this error and i cant seem to figure out why
Warning: file_get_contents(C:/xampp/htdocs) [function.file-get-contents]: failed to open stream: Permission denied in C:\xampp\htdocs\ucuk\news.php on line 157
heres my code
<?php
// Build SQL Query
$query = ("SELECT * FROM heading LEFT JOIN sub_heading ON heading.heading_id = sub_heading.month"); // SQL query
$string = mysql_query($query) or die (mysql_error());
$totalRows = mysql_num_rows($string);
?>
<?php
$resource = mysql_query($query);
$previous_heading = false;
// This will print the headings in a unordered list, modify if needed
while($resource = mysql_fetch_assoc($string)) {
if(!$previous_heading || $previous_heading != $resource['heading']) {
if($previous_heading) {
}
echo $resource['heading'];
}
?>
<?php if ($totalRows > 0) { // Show if recordset not empty ?>
<div id="report">
<?php echo $resource['title']; ?>
<img id="reportimg" src="..<?php echo $resource['img']; ?>" />
<?php
$file = $_SERVER['DOCUMENT_ROOT'] . $resource['txt'];
$contents = file_get_contents($file);
print $contents;
$previous_heading = $resource['heading'];
?>
</div>
<?php } // Show if recordset not empty ?>
<?php } // Close the while statement ?>