Wrox Programmer Forums
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 November 19th, 2004, 03:53 PM
Authorized User
Join Date: Oct 2004
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default Code error!?!?

Ok, i'm going insane here. I'm very new to php so i bought Beginning PHP 4 to learn. I'm Trying to get the code from chapter 10 File and Directory Handling to work. However if i use their code (avialable via download) all i get is the following error...

Fatal error: Cannot redeclare html_header() (previously declared in /Users/brian/Sites/php/common.inc:14) in /Users/brian/Sites/php/common.inc on line 9
as far as i can tell the thml_header() is only declared once. What am i missing? I'm a bit peeved that their code isn't in working order. There's really no excuse for that.

Old November 26th, 2004, 12:39 PM
richard.york's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts

There might be a file that includes the function, or html_header() might be a new function to PHP included in a version of the language that came out after this book was released.

Beginning PHP 4 is an old book, the code in Beginning PHP 4 was written with an older version of PHP 4. The code in this book really looks more like PHP 3 code. Beginning with PHP 4.2.0 PHP made some radical changes, of course this was well after Beginning PHP 4 was released, so you can hardly blame the authors for it, since you're using a much newer version of the language than they did. And if you hadn't realized, there is a Beginning PHP 5 book out now.


Mail_IMAP: A PHP/C-Client/PEAR solution for webmail
Author: Beginning CSS: Cascading Style Sheets For Web Design
Old November 26th, 2004, 03:54 PM
Authorized User
Join Date: Oct 2004
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts

Ah...very good point. I guess I bought the PHP 4 book just because I new PHP 5 wasn't as prevalent yet. I know PHP 5 is a major updgrade. However, i'm guessing it's still backward compatible? Meaning my current PHP 4 code should work if I install 5 on the server?


Old November 26th, 2004, 07:47 PM
Friend of Wrox
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts

Yes, PHP5 is backward-compatible.

Where will you be in 100 years?
Try new FreshView 0.2!

Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Code Error rhapsidee VB.NET 2002/2003 Basics 1 May 27th, 2008 07:04 AM
Error in Code NadAf BOOK: Ivor Horton's Beginning Visual C++ 2005 0 February 18th, 2008 11:16 PM
Code error reverand Excel VBA 1 November 15th, 2006 02:08 AM
Code error??? emyr BOOK: Beginning Java 2 1 October 31st, 2006 05:47 PM
Error displayed with error trap code stoneman Access 4 February 28th, 2004 02:53 PM

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