Re: Starnge parse problem

From: Date: Thu, 01 Jan 1970 00:00:00 +0000
Subject: Re: Starnge parse problem
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-17370@lists.php.net to get a copy of this message
George, You were missing an ending curly brace. Check out the last few lines and see where it was missing. When you get odd errors like this, start counting brackets and parens and braces to make sure they add up to an even amount. In this case, you had an odd number of braces so I just matched up the pairs and found that you never closed the FOR loop. BTW, you also have some <BR> statements that are totally outside of any strings that are going to cause errors and your function as written will not work. Once you remove the <BR> s you are going to find that you are going to need to work on the logic as it still won't due what you are expecting but at least you can run it and go from there. Jim -------Original Message------- From: George Pitcher Date: Tuesday, December 10, 2002 01:21:01 To: php-windows@lists.php.net Subject: [PHP-WIN] Starnge parse problem Hi guys, I am starting to build a calendar. I know that there are resources out there but I want to learn, so I'm starting from scratch. I've got my thinking this far and I've hit an unexpected snag. When I call the page containing the following script: <?php $max = date("t"); $dateM = date("n"); $dateY = date("Y"); $dateNow = date("j"); echo "<Table width=70% border=1>"; for ($x = 1; $x < = $max; $x++) < BR> < BR> { $dayName = date ("l", mktime(0,0,0,$dateM,$x,$dateY)); $dayNum = date ("w", mktime(0,0,0,$dateM,$x,$dateY)); $d1 = 0; while ( $dayNum > $d1 ) { if ( $d1 == 0 ) { echo "<tr><td bgcolor=gray>&nbsp;</td>"; } else { echo "<td bgcolor=cornflower>&nbsp;</td>"; } } if ( $dateNow == $x && $dayNum == 0 ) < BR > < BR > { echo "</tr><tr><td bgcolor=yellow>".$x."</td>"; } else { if ( $dateNow == $x && $dayNum == 6)< BR > < BR > { echo "<td bgcolor=yellow>".$x."</td>"; if ( $dayNum == 0 ) { echo "</tr><tr><td bgcolor=gray>".$x."</td>"; } else { echo "<td bgcolor=cornflower>".$x."</td>"; } }< BR > } } // THIS IS THE ONE THAT WAS MISSING !!!!!! echo "</tr>"; echo "</Table>"; ?> I get this error: "Parse error: parse error, unexpected $ in c:\inetpub\wwwroot\Month2.php on line 48" Now can anyone suggest where I've gone wrong? Cheers George in Oxford === George Pitcher HERON Technical Manager Ingenta plc 23-38 Hythe Bridge Street, Oxford, OX1 2ET T +44 (0)1865 799137 direct T +44 (0)1865 799000 switchboard F +44 (0)1865 799134 E george.pitcher@ingenta.com www.ingenta.com Ingenta: Empowering the exchange of academic and professional content online. -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php .

« previous php.windows (#17370) next »