To complete the requirements for Chapter 10's # 2 pursue question... Do we rewrite the form and submit one that looks like this?
if ($_SERVER['REQUEST_METHOD'] == 'GET') {
// Check for values:
if ( is_numeric($_GET['quantity']) AND is_numeric($_GET['price']) ) {
// Call the function and print the results:
$total = calculate_total($_GET['quantity'], $_GET['price']);
print "<p>Your total comes to $<span style=\"font-weight: bold;\">$total</span>.</p>";
} else { // Inappropriate values entered.
print '<p style="color: red;">Please enter a valid quantity and price!</p>';
}
}
And then change the form method to GET, or is the author looking for something else? Maybe I've missed the whole concept here?
Also - for the 3rd question in the pursue - I understand that I need to create a new line item after line 38 called make_text_input('password', 'Password'); But I cannot connect the dots as to what goes above that? I am trying to process this through by looking at page 269. I have a feeling I need to add something in the if function. Can you direct me in the right direction.
Sorry for the dumb questions, but this is really above my scope of understanding and I'm trying to put it into a language I do understand!
Thanks!
April