Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5
This is the forum to discuss the Wrox book Beginning PHP4 by Wankyu Choi, Allan Kent, Chris Lea, Ganesh Prasad, Chris Ullman; ISBN: 9780764543647
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 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 31st, 2004, 01:55 PM
Registered User
 
Join Date: Jul 2003
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default PHP5 Errata - Pages 207-208

I think I've uncovered some errata for this newly purchased book and the form to post errata wasn't working... so I'd like to post it here and see if someone can validate the error.

The code block at the top of page 207 reads:

<?php
$WelcomeMessage = "Hello world";
function translate_greeting($WelcomeMessage)
{
   $WelcomeMessage = "Bonjour Tout Le Monde";
   return $WelcomeMessage;
}
translate_greeting();
echo $WelcomeMessage;
?>

When I run this code, I receive a PHP error: Missing argument 1 for translate_greeting()...

I can fix it by simply changing the function to:
function translate_greeting().

This same error appears on the next page of the book.

Legitimate errata?



 
Old August 4th, 2004, 05:54 PM
Registered User
 
Join Date: Aug 2004
Location: longmont, colorado, USA.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Exitus Send a message via Yahoo to Exitus
Default

<?php
$WelcomeMessage = "Hello world";
function translate_greeting($WelcomeMessage)
{
   $WelcomeMessage = "Bonjour Tout Le Monde";
   return $WelcomeMessage;
}
translate_greeting();
echo $WelcomeMessage;
?>

The reason is simple.
The argument that is used in the function($WelcomeMessage) was not supplied when you called it. You need to modify the line translate_greeting(); so that it looks like this:

translate_greeting($WelcomeMessage);

That should work.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Master Pages, Content Pages and CSS carliviris Visual Studio 2005 0 January 8th, 2008 05:56 PM
Chapter 5 - Try It Out: Pages 208-210 Wyatt70 BOOK: Beginning XML 3rd Edition 5 November 22nd, 2006 06:54 AM
ch 7 page 208 commit.php pipdickenz BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 1 September 8th, 2004 12:08 PM
Web pages constructing: I-mode(mobile) pages karib Dreamweaver (all versions) 3 June 6th, 2004 09:48 AM





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