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: PHP and MySQL 24-Hour Trainer
This is the forum to discuss the Wrox book PHP and MySQL 24-Hour Trainer by Andrea Tarr ; ISBN: 978-1-1180-6688-1
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: PHP and MySQL 24-Hour Trainer 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 Display Modes
  #11 (permalink)  
Old March 28th, 2012, 08:40 PM
Registered User
Points: 26, Level: 1
Points: 26, Level: 1 Points: 26, Level: 1 Points: 26, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2012
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default editiing PHP.ini file

I'm completely new to PHP and MySQL so I"m not familiar with editing the PHP.ini file. Could you walk me through that?
Reply With Quote
  #12 (permalink)  
Old April 4th, 2012, 11:11 PM
Registered User
Points: 12, Level: 1
Points: 12, Level: 1 Points: 12, Level: 1 Points: 12, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Smile Lesson 7 Errata

I believe step 5 on page 106 has an error. The code in the book is:

<?php
switch (isset($_GET['content'])) :
case 'gents' :
case 'sporting' :
case 'women' :
include 'content/catnav.php';
endswitch;
?>

This always evaluates to 'TRUE', so the catnav.php is always included on all pages. I believe the correct code should be:

<?php
if (isset($_GET['content'])) :
switch ($_GET['content']) :
case 'gents' :
case 'sporting' :
case 'women' :
include 'content/catnav.php';
endswitch;
endif;
?>

I'm really enjoying the book.

Dan McGuffin
Reply With Quote
  #13 (permalink)  
Old April 5th, 2012, 09:23 AM
Tarrconsulting's Avatar
Wrox Author
Points: 50, Level: 1
Points: 50, Level: 1 Points: 50, Level: 1 Points: 50, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2011
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The php.ini file is a straight text file so you can edit it in Notepad or any code editor (just not a word processing editor like Word). There could be multiple php.ini files -- there will be one that covers php in general and then you could also have one that overrides certain commands more local to your site.

The online PHP manual contains more complete information: http://php.net/manual/en/configuration.file.php
Reply With Quote
  #14 (permalink)  
Old April 5th, 2012, 09:27 AM
Tarrconsulting's Avatar
Wrox Author
Points: 50, Level: 1
Points: 50, Level: 1 Points: 50, Level: 1 Points: 50, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2011
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for pointing that out. There's nothing more frustrating than a mistake in the code examples when you are learning a programing language. I'll get that added to the errata.

The code in the downloadable code files has the correct code, I'm happy to say.

I'm glad you are enjoying the book. :)
Reply With Quote
Reply


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



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


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