Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0
This is the forum to discuss the Wrox book Beginning PHP5, Apache, and MySQL Web Development by Elizabeth Naramore, Jason Gerner, Yann Le Scouarnec, Jeremy Stolz, Michael K. Glass; ISBN: 9780764579660
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 27th, 2005, 05:25 AM
Registered User
 
Join Date: Jul 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 2 {curly bracket} parse error of DEATH

Ok, I am a beginner in PHP (Hence buying a book called Beginning PHP5.....).

I've worked my way into chapter 2, with the moviesite.php file working upto the point where I'm on page 47 and passing the visitors username. The code I've typed into Moviesite is

<?php
session_start();

//check to see if user has logged in with a valid password
    if ($_SESSION['authuser'] !=1 {
    echo "Sorry, but you don't have permission to view this page.....";
    exit();
}
?>
<HTML>
<HEAD>
<TITLE>My Movie Site - <?php echo $_REQUEST['favmovie']; ?></TITLE>
</HEAD>
<BODY>
<?php
    echo "Welcome to our site, ";
    echo $_SESSION['username'];
    echo "My favorite movie is ";
    echo $_REQUEST['favmovie'];
    echo "<br>";
    $movierate = 5;
    echo "My movie rating for this movie is: ";
    echo $movierate;
?>
</BODY>
</HTML>

which I've checked and rechecked again and again. When trying to access the moviesite.php in my browser I generate this error message in my log file:

[Wed Jul 27 12:22:52 2005] [error] PHP Parse error: parse error, unexpected '{' in /Library/WebServer/Documents/moviesite.php on line 5

I'm at a bit of a dead end with this one, I've done a lot looking in the php.ini file, my session.save path is good, but the curly bracket parse error of DEATH is killing me..... Help oh wise ones out there...... pleeeeaaassseee......

Reply With Quote
  #2 (permalink)  
Old August 4th, 2005, 08:52 AM
Authorized User
 
Join Date: Aug 2005
Location: , , Canada.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

your line of ($_SESSION['authuser'] !=1 {
is missing the closing bracket. should be

if ($_SESSION['authuser'] !=1) {

PS I am working on chapeter 3.
Reply With Quote
  #3 (permalink)  
Old August 5th, 2005, 08:30 AM
Registered User
 
Join Date: Jul 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks fot the reply GranDad, I eventually figured it out after going through the code for the 5th time! Must get my hands on a decent PHP editor that highlights the code as I type it.

Appreciate the time you took looking into my problem.

I'm getting onto Chapter 3 myself!

Reply With Quote
  #4 (permalink)  
Old August 5th, 2005, 03:36 PM
Authorized User
 
Join Date: Aug 2005
Location: , , Canada.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I would recomend HTML-Kit. It is formidable to configure because there are so many options. But I found a tutorial on the web that guides you thru the config. Look at http://www.chami.com/html-kit/support/refs/

HTML-Kit is free and you can download it from http://www.chami.com/html-kit/download/

Regards
Al
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Parse error: parse error, unexpected T_STRING geminient PHP How-To 4 August 18th, 2007 02:27 AM
Parse error: parse error, unexpected $end Ayodeji Adegbaju Pro PHP 3 January 12th, 2007 12:21 PM
Chapter 5 Parse Error razorack BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 2 February 6th, 2005 10:43 AM
Where are Curly Braces required? ababb BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 2 January 20th, 2005 11:47 AM
Parse error in error handler (Chapter 8) Funky Monk BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 1 August 6th, 2004 08:59 AM



All times are GMT -4. The time now is 12:15 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.