Jump to content

Calendar Error


timmah1

Recommended Posts

I have an event calendar, and right now, I'm getting an error and i don't understand why.

 

My error is this

Parse error: syntax error, unexpected ';' in view.php on line 45

 

Line 45 is this

$daysleft = 6 - $weekday-;

 

My code before this is this

session_start();

require("config.php");

//if(isset($_SESSION['USERNAME']) == FALSE) {
//	header("Location: " . $config_basedir);
//}

function short_event($name) {
	$final = "";
	$final = (substr($name, 0, 12) . "...");

	return $final;
}

require("header.php");

if($_GET['error']) {
	echo "<script>newEvent('" . $_GET['evendate'] . "', 1)</script>";
}

$cols = 7;
$weekday = date("w", mktime(0, 0, 0, $month, 1, $year));
$numrows = ceil(($numdays + $weekday) / $cols);

echo "<br />";
echo "<table class='cal' cellspacing='0' cellpadding='5' border='1'>";
echo "<tr>";
echo "<th class='cal'>Sunday</th>";
echo "<th class='cal'>Monday</th>";
echo "<th class='cal'>Tuesday</th>";
echo "<th class='cal'>Wednesday</th>";
echo "<th class='cal'>Thursday</th>";
echo "<th class='cal'>Friday</th>";
echo "<th class='cal'>Saturday</th>";
echo "</tr>";

$counter = 1;
$newcounter = 1;

echo "<tr>";

$daysleft = 6 - $weekday-;

This is not the entire code, just up to the error

 

Can anybody help me out here?

 

Thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/122479-calendar-error/
Share on other sites

Perfect Porl123!

 

I no longer get the error, but the calendar shows 7 rows, 5 columns.

 

 

The top row for this month is as follows

Sunday Monday Tuesday Wednesday Thursday Friday Saturday

              1          2              3            4      5        6

 

 

But, for every row after that, the days are labled 02, any idea why that would be?

Link to comment
https://forums.phpfreaks.com/topic/122479-calendar-error/#findComment-632440
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.