Wrox Programmer Forums
|
BOOK: PHP and MySQL: Create-Modify-Reuse ISBN: 978-0-470-19242-9
This is the forum to discuss the Wrox book PHP and MySQL: Create-Modify-Reuse by Timothy Boronczyk, Martin E. Psinas; ISBN: 9780470192429
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: PHP and MySQL: Create-Modify-Reuse ISBN: 978-0-470-19242-9 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 August 4th, 2008, 03:37 AM
Registered User
 
Join Date: Aug 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Possible Error? - CH1 Regiser.php

I've been wrestling with this problem for a while so I downloaded the source code and tried that unmodified. Same problem.

I have the Production Environment flag (common.php) set to false in order to receive error messages. With that set, entering any sort of erroneous input during the registration process in "register.php" will result in the following error:
Code:
Notice: Undefined index: TEMPLATE in ../Wrox_Code/ch_01/public_files/register.php on line 105

Notice: Undefined index: content in ../Wrox_Code/ch_01/public_files/register.php on line 105
Now, line 105 is in this section of the code (the first $GLOBALS line here):
Code:
    // there was invalid data
    else
    {
        $GLOBALS['TEMPLATE']['content'] .= '<div id=Error></div><p><strong>You provided some ' .
            'invalid data.</strong></p> <p>Please fill in all fields ' .
            'correctly so we can register your user account.</p></div>';
        $GLOBALS['TEMPLATE']['content'] .= $form;
    }
    It fails in my code and it fails in the downloaded code from this site and yet I can't for the life of me see anything wrong with it.

Can anyone shed any light on this?

Thanks in advance.

AD

 
Old August 10th, 2008, 09:13 PM
Authorized User
 
Join Date: Jul 2008
Posts: 12
Thanks: 1
Thanked 1 Time in 1 Post
Default

There is a . that shouldn't be there. Changing .= to = fixes the bug. Line 105 should read:

Code:
$GLOBALS['TEMPLATE']['content'] = '<p><strong>You provided some ' .
     'invalid data.</strong></p> <p>Please fill in all fields ' .
     'correctly so we can register your user account.</p>';


The .= on line 108 is correct.

-Tim
 
Old August 12th, 2008, 02:50 AM
Registered User
 
Join Date: Aug 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ahhh Yesss!

That did it. Thank you very much.

Much appreciated....

AD






Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch1 MySQL returns Error 1046: No database selected aiche_ag BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 1 October 1st, 2007 02:47 PM
Ch1, why using CollectionBase class? NewTitle2007 BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 3 August 5th, 2007 06:32 AM
wrox php error mool Pro PHP 0 February 22nd, 2007 02:39 AM
Error: movie.php & commit.php on p182-186, ch6 willburke BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 October 12th, 2004 02:48 PM





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