Page 1 of 1

Am I having a problem with PEAR?

Posted: Wed Feb 18, 2009 11:49 am
by Steve C
I am relatively new to php and I have a problem that I can't figure out with some scripts I found online in a php tutorial that wish to use to study OOP. Here is the URL:

http://www.hosting.vt.edu/tutorials/phpmysql/#about

The scripts are located under the section "Putting it all together in web-based personal address book" (at least 3/4 of the way down the page).

The scripts are entitled:

dbconnect.php
listcontacts.php
addcontact.php
editcontact.php
deletecontact.php

I reconfigged dbconnect.php and am making the connection fine (I pulled data out of it to an altered version of dbconnect.php script)... but when I try to run listcontacts.php I get the following error message:

"Parse error: syntax error, unexpected T_STRING in /Users/steve/Sites/address book/listcontacts.php on line 5"

I commented out line 5, which read:


if ( isset($_GET['sort']) && $_GET['sort']=='firstname' ) { $_SESSION['sort'] = 'firstname'; } else { $_SESSION['sort'] = 'lastname'; }


I've gotten this error plenty of times and have found the source of the problem relatively easily most of the time... but this one has me stumped. Ultimately I'd like to know if these scripts can be run by anyone but the author (who demoes them live on the site).


Thanks
Steve

Re: Am I having a problem with PEAR?

Posted: Sun Feb 22, 2009 11:38 pm
by php_east
the file parse ok on my local.