perry Posted January 23, 2012 Share Posted January 23, 2012 Since I'm such a newbie I must be looking at this incorrectly... On page 50, in Chapter2, line 46 it says "echo '<p><b>Good day, Sir!</b></p>';" thus showing an echo statement. But at the top of page 52, in step 6 it says "$greeting = '<p><b>Good day, Sir!</b></p>';" thus assigning a variable. It's the same with "Madam" below it. What am I missing? Thanks for any and all help! Perry Link to comment Share on other sites More sharing options...
Paul Swanson Posted January 23, 2012 Share Posted January 23, 2012 I'm betting that a few lines further down the script has echo $greeting; (at least the 2nd Edition does, except it uses $message as the variable name). Link to comment Share on other sites More sharing options...
Jaepee Posted January 24, 2012 Share Posted January 24, 2012 Line 43 $gender = $_REQUEST['gender'] Either M for Male or F for Female. $_REQUEST['gender'] is a value received from your form radio buttons (e.g.) M or F Line 45 is your if conditional Basicly saying if $gender = M print <p><b>Good day, Sir!</b></p> if $gender is not M then the elseif ($gender == F) checks to see if the value is equal to F for female, if the user checked the box for female then the output would be LINE 48 <p><b>Good day, Madam!</b></p> Line 50 would be $gender = NULL; // meaning no value, the radio GENDER button was not clicked. Then line 51 the error message Gender should either be "M" or "F"! Hope this helps jp Link to comment Share on other sites More sharing options...
Recommended Posts