Wrox Programmer Forums
| 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #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......

  #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.
  #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!

  #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


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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.