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: 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 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
  #1 (permalink)  
Old August 4th, 2008, 04:37 AM
Registered User
 
Join Date: Aug 2008
Location: London, , United Kingdom.
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

Reply With Quote
  #2 (permalink)  
Old August 10th, 2008, 10:13 PM
Authorized User
 
Join Date: Jul 2008
Location: Syracuse, NY, USA.
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
Reply With Quote
  #3 (permalink)  
Old August 12th, 2008, 03:50 AM
Registered User
 
Join Date: Aug 2008
Location: London, , United Kingdom.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ahhh Yesss!

That did it. Thank you very much.

Much appreciated....

AD

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

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 03: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 07: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 03:48 PM



All times are GMT -4. The time now is 10:48 AM.


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