Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| 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 November 19th, 2004, 03:53 PM
Authorized User
 
Join Date: Oct 2004
Location: Denver, CO, USA.
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...

Code:
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.

Reply With Quote
  #2 (permalink)  
Old November 26th, 2004, 12:39 PM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

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.

Regards,
Rich

--
[http://www.smilingsouls.net]
Mail_IMAP: A PHP/C-Client/PEAR solution for webmail
Author: Beginning CSS: Cascading Style Sheets For Web Design
Reply With Quote
  #3 (permalink)  
Old November 26th, 2004, 03:54 PM
Authorized User
 
Join Date: Oct 2004
Location: Denver, CO, USA.
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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?

Cheers,
Brian

Reply With Quote
  #4 (permalink)  
Old November 26th, 2004, 07:47 PM
Friend of Wrox
 
Join Date: Nov 2003
Location: , , .
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Yes, PHP5 is backward-compatible.

-Snib
Where will you be in 100 years?
Try new FreshView 0.2!
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
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



All times are GMT -4. The time now is 06:08 AM.


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