the content of my headline.php are:
[Admin Edit:
Code: Select all
Code: Select all
<?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 = '$pagesCode: Select all
'
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="$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=$pagesCode: Select all
">";
print "<FONT SIZE=1>Read more $pagesCode: Select all
...</FONT>";
print "</A>";
print "</TABLE>";
}
}
}
include "footer.php";
?>
while the content of page.php are:
<?php
require_once("include_fns.php");
require_once("header.php");
$conn = db_connect();
if (!$page) {
header("Location: headlines.php");
exit;
}
$sql = "select * from stories
where page = '$page'
and published is not null
order by published desc";
$result = mysql_query($sql, $conn);
while ($story = mysql_fetch_array($result)) {
print "<H2>".$story['headline']."</H2>";
if ($story['picture']) {
$size = getImageSize($story['picture']);
$width = $size[0];
$height = $size[1];
print "<IMG SRC="$story[picture]" HEIGHT=$height WIDTH=$width ALIGN=LEFT>";
}
print $story['story_text'];
$w = get_writer_record($story['writer']);
print "<br><FONT SIZE=1>";
print $w['full_name'].", ";
print date("M d, H:i", $story['modified']);
print "</FONT>";
}
include "footer.php";
?>Code: Select all
print "<A HREF="page.php?page=$pagesCode: Select all
">";
print "<FONT SIZE=1>Read more $pagesCode: Select all
...</FONT>";when i click on the hyperlink the following error comes up:
I need help on how page.php can recognize the variable $page as it is been used here.Notice: Undefined variable: page in c:\program files\apache group\apache\htdocs\gprojects\cms\page.php on line 8
Warning: Cannot modify header information - headers already sent by (output started at c:\program files\apache group\apache\htdocs\gprojects\cms\header.php:14) in c:\program files\apache group\apache\htdocs\gprojects\cms\page.php on line 9
Thanks