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 January 12th, 2005, 11:39 AM
Registered User
 
Join Date: Jan 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 4> ERROR using "=>>>"

I have copied and used the code downloaded from this site and keep having the same php error on the exercise on page 132 (spanish edition)>> '' Parse error: parse error, unexpected $ in /Library/Apache2/htdocs/pphp/capt4/Copy of table1.php on line 16 '',
I know it should be simple but

thanks for any help

GUiro
 
Old January 12th, 2005, 02:47 PM
Authorized User
 
Join Date: Dec 2004
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by guiro
 I have copied and used the code downloaded from this site and keep having the same php error on the exercise on page 132>> '' Parse error: parse error, unexpected $ in /Library/Apache2/htdocs/pphp/capt4/Copy of table1.php on line 16 '',
I know it should be simple but

thanks for any help

GUiro
The parse error is saying that you have an unexpected $ at line 16. So...line 16 of table1.php is supposed to be echo $movie. Well, you either did not properly initiate the variable earlier in the code or you perhaps have more than one $ or a different un-initiated variable on this line. We need to see the code that [u]YOU</u> are using before we can offer any more advice. Please copy/paste it here.

On another note, I am a little confused, because the title of your post references pg132. However, the script table1.php is actually back on pg111-112. So...am I missing something or was it simply a type on your part? Anyway, I'm just trying to get to the root of your problem.

 
Old January 12th, 2005, 04:43 PM
Registered User
 
Join Date: Jan 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ok, I should have said that I am using the spanish edition of the book in witch the code appears at page 132. The code is:

<?php
     $movie=<<<EOD
     <h2><center>Movie Review Database</center></h2>
     <table width='70%' border='1' cellpadding='2'
       cellspacing='2' align='center'>
          <tr>
               <th>Movie Title</th>
               <th>Year of Release</th>
               <th>Movie Director</th>
               <th>Movie Lead Actor</th>
               <th>Movie Type</th>
          </tr>
     </table>
EOD;

     echo $movie;
?>

just as I copied from the site.
I may have to say also that I am working on a mac OSX system.

Thank you for tour help.

GUiro
 
Old January 13th, 2005, 12:15 PM
Registered User
 
Join Date: Jan 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well I believe that the problem is in working with "=<<<", I have even tried with the code

<?php
$movie=<<<EOD
     <h2><center>Movie Review Database</center></h2>
EOD;

     echo $movie;
?>

and still have the same answer with diferent error line number

Parse error: parse error, unexpected $ in /Library/Apache2/htdocs/pphp/capt4/table1_pr0.php on line 6

Probably it is the php version I am using (PHP Version 4.3.9), I really don't know

could I skip this? or do it in any other way?
 
Old January 13th, 2005, 05:28 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

I'm not sure why they do it this way, but you can replace the section you posted with the following for the same thing:

Code:
$movie = "
     <h2><center>Movie Review Database</center></h2>
     <table  width='70%' border='1' cellpadding='2'
       cellspacing='2' align='center'>
          <tr>
               <th>Movie Title</th>
               <th>Year of Release</th>
               <th>Movie Director</th>
               <th>Movie Lead Actor</th>
               <th>Movie Type</th>
          </tr>
     </table>
";
echo $movie;
hth,

-Snib - http://www.snibworks.com
Where will you be in 100 years?
 
Old January 13th, 2005, 06:38 PM
Registered User
 
Join Date: Jan 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

it worked beutifully, thanks





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chpt 7 >> Pg 245 >>Try It Out #4-5 harrison4411 BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 0 March 2nd, 2006 06:26 PM
Achitecture ? SQL -> XML -> ASP -> PDF or HTML Frm jstrong Classic ASP XML 0 July 9th, 2005 01:18 PM
<style> tags in a <body> vs. <div> bcat BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 1 March 27th, 2005 08:50 AM
VB.Net -> Filename -> DTS Package -> tempdB daniel Pro VB.NET 2002/2003 1 October 7th, 2004 01:46 PM
<<ASP.NET Security>>,download files in chapter 8 alaix All Other Wrox Books 1 July 24th, 2003 10:29 AM





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