PDA

View Full Version : Parse Error on Demo.PHP after Install


HaloFX
01-20-2004, 05:30 AM
First time out with this script, here is the error when viewing demo.php:
Parse error: parse error, expecting `')'' in escal.php on line 22

FreeBSD 4.4
PHP 4.0

Loaded files with WSFTP and DreamweaverMX.
Just getting started with PHP. Suppose it could be something simple.

Thanks for the help, script looks like it will be just what I am looking for.

ve9gra
01-20-2004, 07:01 AM
Which version of the script are you using?

Brian
01-20-2004, 08:59 AM
Is the error for the demo.php file or another file?

Have you modified the code in any way?

HaloFX
01-20-2004, 01:28 PM
I am using Version 4.4, just downloaded yesterday.

I get the error with no modifications, and when I setup for mySQL use, no difference.

I get this when I view demo.php:
Parse error: parse error, expecting `')'' in escal.php on line 22

and this when I view escal.php:
Parse error: parse error, expecting `')'' in /usr/local/etc/httpd/htdocs/escal/escal.php on line 22

Thanks

Brian
01-20-2004, 01:31 PM
Can you post a link to your calendar?

ve9gra
01-20-2004, 01:44 PM
how about posting what you have in escal.php between lines 15-30...

might've been corrupted durring transfer....

HaloFX
01-20-2004, 02:57 PM
Installed at:
http://degauss.com/escal/

ESCal.php lines 12-37:
// CHECK PHP VERSION
$pv = explode(".",phpversion());
$pv = $pv[0].".".$pv[1];
$pv = $pv-4.1;

// READ CONFIGURATION FILE
require ("escalConfig.php");

// RESET EVENTS
if ($resetEvents==1) {
&nbsp;unset($es, $ee, $eTitle); &nbsp; &nbsp;// &nbsp;<- Line 22
&nbsp;}

// SET VARIABLES
if ($pv>=0) {
&nbsp;if (!isset($mo)) $mo = $_REQUEST["mo"];
&nbsp;if (!isset($yr)) $yr = $_REQUEST["yr"];
&nbsp;if (!isset($ee)) $ee = $_REQUEST["ee"];
&nbsp;if (!isset($es)) $es = $_REQUEST["es"];
&nbsp;}
if ($pv<0) {
&nbsp;if (!isset($mo)) $mo = $HTTP_GET_VARS["mo"];
&nbsp;if (!isset($yr)) $yr = $HTTP_GET_VARS["yr"];
&nbsp;if (!isset($ee)) $ee = $HTTP_GET_VARS["ee"];
&nbsp;if (!isset($es)) $es = $HTTP_GET_VARS["es"];
&nbsp;}

tomB
01-20-2004, 03:07 PM
Almost sounds as though there was a ")" in the content of one of the variables.

More than likley in $eTitle;

insert &nbsp;echo $ee . $es . $eTitle; at line 20.

See what is printed on the page.

tomB

ve9gra
01-20-2004, 03:16 PM
I doubt it as he's not using a database and the flat file doesn't have any ")" in it.

HaloFX
01-20-2004, 03:18 PM
TomB,

Adding that line gave the same error, line 23 instead of 22.

ve9gra
01-20-2004, 05:20 PM
I would like you to test something...

escalConfig.php, line 59

change the value of $resetEvents to 0... i want to pinpoint the problem to within the if or outside of it..

this is not a fix... it's just testing.

something else i noticed... according to a fresh unzip of ESCal44.zip

// RESET EVENTS
if ($resetEvents==1) {
&nbsp;unset($es, $ee, $eTitle);
&nbsp;} // <---- original line 22

so something else might be wrong somewhere else..

HaloFX
01-20-2004, 06:40 PM
I had forgot I added the errorreporting=0 line at the beginning just incase earlier.
That explains Why I was one line off from you. It has been removed.

I changed resetEvents to 0, but that made no change in the parse error. It now reads:
Parse error: parse error, expecting `')'' in escal.php on line 21

Papa, I PM'd you with a link to a phpinfo(); inc ase there is perhaps something goofy with my setup.

ve9gra
01-20-2004, 06:57 PM
send me your escal.php file at the address i'll PM you in a sec...

ve9gra
01-20-2004, 10:04 PM
And BOOM!!! Found the problem!!! ;)

Time to upgrade your PHP version... You currently have PHP version 4.0.0

As extracted from the PHP v4.0.1 release notes (http://news.php.net/article.php?group=php.announce&article=23)...

- Added support for multiple arguments in unset(). (Faisal, Zend Engine)

So if you don't want to upgrade your PHP version, you can change line 21 from
unset($es, $ee, $eTitle);tounset($es); unset($ee); unset($eTitle);
this is all on one line to not mess up the line numbers for further troubleshooting, should the need arise...

If you get any more problems with unset, just make sure that there's only 1 argument passed to it.

i hope that with this, you'll have smooth sailing from now on and enjoy using ESCalendar...

HaloFX
01-20-2004, 11:00 PM
COOL! One problem down. But like many times that introduced 2 more.

I got a SQL error when I tried to use the mySQL install. Not a huge problem, I copied the code out and inserted the table with myPhpAdmin.

Now when I add an event with with escalAE.php I am having some problems.

I add an event for 1-24-2004, event length 1, Desc "Hello World".

On the confirm page, the date displayed is 1-23-2004 and no description.
It also displays the following error on the page:
Warning: Wrong parameter count for htmlspecialchars() in /usr/local/etc/httpd/htdocs/escal/escalAE.php on line 130


If I save the event I get this error:
Warning: Wrong parameter count for htmlspecialchars() in /usr/local/etc/httpd/htdocs/escal/escalAE.php on line 172

When I view the events in tabular form I see at as 12-31-1969, and no description.

The correct date is displayed on the calender on demo.php, but it is not clickable.

When I browse the escEvents table in myPhpAdmin I see the date as 2004-01-23, but no description. If I manually insert a record on 1-30-2004 it shows up on the 29th in the calendar, displays as 12-31-1969 in the tabular view events. It is clickable in the calendar, but no text displays.

I am I looking at another PHP 4.0.0 issue? or something in the code?

Thanks again for your help!!

ve9gra
01-20-2004, 11:11 PM
seems like another PHP version problem... according to the htmlspecialchars documentation...
Support for the optional second argument was added in PHP 3.0.17 and PHP 4.0.3.

are you staying on 4.0.0 for a reason? because there has been some major changes in most functions since then... i'm on 4.3.4 (latest stable version)

HaloFX
01-20-2004, 11:33 PM
We have some older custom code for a client running that the developer is no longer on the scene. I have tried moving the app to another server with a newer PHP version, and we had some issues; some have been resolved but others are still hanging. We are prepping for a migration in a few months to another server, but am trying to take things slow.

Looks like the calendar may have to be put on hold till after our migration.

Now that I think of it, we had to use 2.2.7 of phpMyAdmin, 2.5.5 wouldn't run right. Probably PHP 4.0.0 related.

Thanks again for all your help. Maybe 4.5 will be out of beta when we are done.

Brian
01-22-2004, 01:09 PM
I'm actually working on Versoin 5.0 now. I still need beta testers for Version 4.5 before I am ready to release it.

Any takers?