Wrox Programmer Forums
|
BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6
This is the forum to discuss the Wrox book Beginning PHP, Apache, MySQLWeb Development by Michael K. Glass, Yann Le Scouarnec, Elizabeth Naramore, Gary Mailer, Jeremy Stolz, Jason Gerner; ISBN: 9780764557446
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 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
 
Old July 28th, 2004, 02:28 AM
Authorized User
 
Join Date: Jul 2004
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Chudz
Default moviesite.php - error line 43

Hi can someone tell me if there is a typing mistake in this php file or can you tell me what i have done wrong? this is the error message my browser shows:

Parse error: parse error, unexpected $end in C:\Program Files\Apache Group\Apache2\test\moviesite.php on line 43

This is my code for moviesite.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, you loser!";
    exit();
    }
?>
<HTML>
<HEAD>
<TITLE>My Movie Site - <? echo $_REQUEST['favmovie'] ?></TITLE>
</HEAD>
<BODY>
<? include "header.php" ?>
<?
    $favmovies = array("Life of Brian","Stripes","Office Space","The Holy Grail",
"Matrix", "Terminator 2", "Star Wars", "Close Encounters of the Third Kind",
"Sixteen Candles", "Caddyshack");

   if (ISSET($_REQUEST['favmovie'])) {
    echo "Welcome to our site, ";
    echo $_SESSION['username'];
    echo "! <br>";
    echo "My favorite movie is ";
    echo $_REQUEST['favmovie'];
    echo "<br>";
    $movierate=5;
    echo "My movie rating for this movie is: ";
    echo $movierate;
}
   else {
   echo "My top movies are: <br>";
   if (ISSET($_REQUEST['sorted'])) {
   sort ($favmovie);
}
    foreach ($favmovies as $currentvalue) {
    echo $currentvalue;
    echo "<br>\n";
}
?>
</BODY>
</HTML>

http://www.uggle.com
http://www.leap2.co.uk
[email protected]
[email protected]
 
Old August 1st, 2004, 05:07 AM
Authorized User
 
Join Date: Jul 2004
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by Chudz
    else {
   echo "My top movies are: <br>";
   if (ISSET($_REQUEST['sorted'])) {
   sort ($favmovie);
}
I believe you are missing a " } " in this section.

 
Old August 1st, 2004, 10:54 AM
Authorized User
 
Join Date: Jul 2004
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Chudz
Default

ok i done that now im gett parse error on line 30 :(

http://www.uggle.com
http://www.leap2.co.uk
[email protected]
[email protected]
 
Old August 2nd, 2004, 03:52 AM
Authorized User
 
Join Date: Jul 2004
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by Chudz
 ok i done that now im gett parse error on line 30 :(
would that be this line:
    echo "! <br>";
next line (31) is:
    echo "My favorite movie is ";

?

Also, did you let the editor scroll your list of movies or did you 'hard code' the CR/LF (enter key)? IOW, did you hi;





Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch3 Moviesite table already exists? aiche_ag BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 August 7th, 2007 01:29 PM
Listing 23-43 wombel BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 0 November 30th, 2006 09:40 AM
moviesite login problem chapter 2 StuartD BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 3 August 15th, 2005 06:04 AM
Running cmd line .EXE through PHP geolast PHP How-To 2 January 6th, 2005 02:34 PM
Chapter 2, pages 68/69 moviesite.php ruairiglenn04 BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 1 August 1st, 2004 05:27 AM





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