Wrox Programmer Forums
| 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 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
  #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?
  #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
  #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
  #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. :)








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