[SOLVED] Newbie unexpected T_VARIABLE error...
Posted: Thu Oct 07, 2004 3:11 am
feyd | Please use
the error is on line 24. Ive had a look but cant seem to see a problem, have i just put an extra space in somewhere and thats causing the problem...
Any help for me the newbie much appreciated....
feyd | Please use
Code: Select all
andCode: Select all
tags where approriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
this is one of my first proper little php coding tests as im very new to php... ive got the following error:Code: Select all
Parse error: parse error, unexpected T_VARIABLECode: Select all
<?php
$initial_entry_date = 001;
$today = date('Ymd');
if (isSet($_GET['date'])) {
if ($_GET['date'] < $initial_entry_date) {
$date = $inital_entry_date;
} elseif ($_GET['date'] > $today) {
$date = $today;
} else {
$date = $_GET['date'];
}
} else {
$date = $today;
}
$title_msg = $date;
$header_msg = "Weblog entry for $date";
$prevdate = $date - 1;
$nextdate = $date + 1;
if ($date == $initial_entry_date) {
$flipbar = "\n<P CLASS="next"><A HREF="$PHP_SELF?date=$nextdate">Next --></A></P>\n";
} elseif ($date == $today) {
$flipbar = "\n<P CLASS="previous"><A HREF="$PHP_SELF?date=$prevdate"><-- Previous</A></P>\n";
} else {
$flipbar = "\n<TABLE BORDER=0><TR><TD WIDTH="50%"
ALIGN="left"><SPAN CLASS="previous"><A
HREF="$PHP_SELF?date=$prevdate"<-- Previous</A></SPAN></TD><TD
WIDTH="50%" ALIGN="right"><SPAN CLASS="next"><A
HREF="$PHP_SELF?date=$nextdate">Next --
></A></SPAN></TD></TR></TABLE>\n";
}
include_once('header.inc');
echo $flipbar;
if (file_exists($DOCUMENT_ROOT."entries/$date.txt")) {
include($DOCUMENT_ROOT."entries/$date.txt");
} else {
include("default.txt");
}
echo $flipbar;
include_once('footer.inc');
?>feyd | Please use
Code: Select all
andCode: Select all
tags where approriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]