View Single Post
  #2 (permalink)  
Old April 7th, 2013, 01:57 PM
Tarrconsulting's Avatar
Tarrconsulting Tarrconsulting is offline
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 Errata fix

I haven't had much luck getting my errata added to the errata on the website. This is the fix:

Chapter 6
lesson06x.php

The Notice error is happening because the first time you open the file the form hasn't been submitted so there are no GET's defined yet. To get rid of these errors when we need to check first that the GET's are defined. We can do that with the isset() function.

Replace the <p></p> line with this:

Code:
<?php if (isset($_GET["username"]) AND isset($_GET["password"])) : ?>
	<p>You entered <?php echo $_GET["username"] ?> as the User Name and <?php echo $_GET["password"] ?> as the Password.</p>
<?php else: ?>
	<p>Please enter your User Name and Password.</p>
<?php endif; ?>
This was just an example and you'll find as you go on we start adding in more robust features.
Reply With Quote