Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 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 28th, 2004, 02:28 AM
Authorized User
 
Join Date: Jul 2004
Location: Connah\'s Quay, , United Kingdom.
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
webmaster@leap2.co.uk
andrewjones702@hotmail.com
Reply With Quote
  #2 (permalink)  
Old August 1st, 2004, 05:07 AM
Authorized User
 
Join Date: Jul 2004
Location: Las Vegas, NV, USA.
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.

Reply With Quote
  #3 (permalink)  
Old August 1st, 2004, 10:54 AM
Authorized User
 
Join Date: Jul 2004
Location: Connah\'s Quay, , United Kingdom.
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
webmaster@leap2.co.uk
andrewjones702@hotmail.com
Reply With Quote
  #4 (permalink)  
Old August 2nd, 2004, 03:52 AM
Authorized User
 
Join Date: Jul 2004
Location: Las Vegas, NV, USA.
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;
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
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



All times are GMT -4. The time now is 11:57 AM.


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