 |
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
|
|
|
|

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

January 12th, 2005, 02:47 PM
|
|
Authorized User
|
|
Join Date: Dec 2004
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|
|

January 12th, 2005, 04:43 PM
|
|
Registered User
|
|
Join Date: Jan 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

January 13th, 2005, 12:15 PM
|
|
Registered User
|
|
Join Date: Jan 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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?
|
|

January 13th, 2005, 05:28 PM
|
|
Friend of Wrox
|
|
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
|
|
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?
|
|

January 13th, 2005, 06:38 PM
|
|
Registered User
|
|
Join Date: Jan 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
it worked beutifully, thanks
|
|
 |