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



Reply With Quote
  #2 (permalink)  
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.

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



All times are GMT -4. The time now is 05:41 PM.


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