WHAT in Heaven's name is a "T_STRING?" Nowhere do I see a definition of T_STRING, or why it is called T_something.
From what I've been able to piece together, it might be an unquoted string.
I have a
Parse error: syntax error, unexpected T_STRING in /home/xxxxxxxx/public_html/include/mmeetingDate.php on line 10
Since today is Saturday, the if statement dealing with Saturday is being run, and that includes the "goto report;" on line 10:
Oops, the code I was about to display did not include the definition of variable $dn, so I re-edited, adding the code that defines $dn, and put it up on my other site.Now the same error occurs on the same line of code, at Line 50.
Here is the front part of my code:
<?php function meetingDate($day = NULL, $week = NULL, $m = NULL, $y = NULL) {
$x = 0;
// $dn is Day Number:
if ((is_string($day))&&($day == 'sun')) {$dn = 1; }
elseif ((is_string($day))&&($day == 'mon')) {$dn = 2; }
elseif ((is_string($day))&&($day == 'tue')) {$dn = 3; }
elseif ((is_string($day))&&($day == 'wed')) {$dn = 4; }
elseif ((is_string($day))&&($day == 'thu')) {$dn = 5; }
elseif ((is_string($day))&&($day == 'fri')) {$dn = 6; }
elseif ((is_string($day))&&($day == 'sat')) {$dn = 7; }
else { # Output HTML: ?>
<p class = "hilite">You have entered: <?php echo $day?><br />
The first argument must be one of <br />
<strong>'sun' 'mon' 'tue' 'wed' 'thu' 'fri' 'sat'</strong></p>
<?php # Resume PHP
$x = 1; }
// Test second argument
if ((is_int($week))&&(($week < 1) or ($week > 5))) { # Output HTML: ?>
<p class = "hilite">You have entered: <?php echo $week?>.<br />
The second argument must be one of <br />
<strong>1 2 3 4 5</strong></p>
<?php # Resume PHP
$x = 1; }
# Test third argument
if ((is_int($m))&&(($m < 1) or ($m > 12))) { # Output HTML: ?>
<p class = "hilite">You've entered: <?php echo $m?>.<br />
The third argument must be one between, inclusive <br />
<strong>1 through 12</strong></p>
<?php # Resume PHP
$x = 1; }
# Test fourth argument
if ((is_float($y))&&(($y < 1970) or ($y > 2037))) { # Output HTML: ?>
<p class = "hilite">You'."'".'ve entered: '.$m.'<br />'."\n".'The fourth argument must be a 4-digit year from 1970 to 2037. <br />
<?php # Resume PHP
$x = 1; }
if ($x == 1 ) {$x = 0; return; }
// The function passed the invalid input test.
$firstofMonth = mktime(0, 0, 0, $m, 1, $y); // UNIX timestamp
$fdd = date('j',$firstofMonth);
$fd = date('w',$firstofMonth);
// Get the day of the week numerically from our timestamp, $fd for First Day
// SAT
if ($fd == 6) {
$dn = $dn -7;
goto report; // Line 50
}
// FRI
if ($fd == 5) {
$dn = $dn -6;
goto report;
}
// THU
if ($fd == 4) {
$dn = $dn -5;
goto report;
}
// WED
if ($fd == 3) {
$dn = $dn -4;
goto report;
}
// TUE
if ($fd == 2) {
$dn = $dn -3;
goto report;
}
// MON
if ($fd == 1) {
$dn = $dn -2;
goto report;
}
// SUN
if ($fd == 0) {
$dn = $dn -1;
goto report;
}
report:
?>
I run XAMPP for Linux 1.7.4 and PHP 5.3.5
Free web site Apache 2 and PHP 5.2*
Paid web site Apache 2 and PHP 5.8.8
Both web sites throw the error, while the code runs just perfectly at home!
Internet must be down.....