Jump to content
Larry Ullman's Book Forums

Stereot

Members
  • Content Count

    8
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Stereot

  • Rank
    Newbie
  1. http://ihrtn.com/form.html It actually works fine when I'm running it via server, but not so much when I do it locally / via hard drive with XAMPP turned on.
  2. Yes sir! But I still see only variables, not values on the resulting php page.
  3. Now it says this at the top of the form: Array ( ) Array ( )
  4. I'm using version 5.3.5 and, unfortunately, changing it to $_POST didn't fix anything. Thank you for advice, though! :-)
  5. Tried it both ways - its the same problem. I don't see actual values showing up - I'm getting only variables themselves.
  6. Also tried to test code from zip file that's on DMCinsights, but it doesn't work right either.
  7. Lets see... form.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"" http://www.w3.org/TR/XHTML1/DTD/ xhtml1-transitional.dtd"> <html xmlns="http://wwww.w3.org/1999/ xhtml" xml"lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset= iso-8859-1" /> <title>Simple HTML Form</title> </head> <body> <!-- Script 2.1 - form.html --> <form action="handle_form.php" method="post"> <fieldset><legend>Enter your information in the form below:</legend> <p><b>Name:</b> <input type="text" name="name" size="20" maxlength="40"/></p> <p><b>Email Address:</b> <input type="text" name="email" size="40" maxlength="60" /></p> <p><b>Gender:</b> <input type="radio" name="gender" value="M" /> Male <input type="radio" name="gendder" value="F" />Female</p> <p><b>Age:</b> <select name="age"> <option value="0-29">Under 30</option> <option value="30-60">Between 30 and 60</option> <option value="60+">Over 60</option> </select></p> <p><b>Comments:</b><textarea name="comments" rows="3" cols="40"></textarea></p> </fieldset> <div align="center"><input type="submit" name="submit" value="Submit My Information" /></div> </form> </body> </html> handle_form.php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"" http://www.w3.org/TR/XHTML1/DTD/ xhtml1-transitional.dtd"> <html xmlns="http://wwww.w3.org/1999/ xhtml" xml"lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset= iso-8859-1" /> <title>Simple HTML Form</title> </head> <body> <?php # Script 2.2 - handle_form.php // Create a shorthand for the form data: $name = $_REQUEST['name']; $email = $_REQUEST['email']; $comments = $_REQUEST['comments']; /* Not used: $_REQUEST['age'] $_REQUEST['gender'] $_REQUEST['submit'] */ // Print the submitted information: echo "<p>Thank you, <b>$name></b>, for the following comments:<br /> <tt>$comments</tt></p> <p>We will reply to you at <i>$email</i>.</p>\n"; ?> </body> </html>
  8. Hi everyone! I just started going through Mr. Ullman's book and really like it so far, but here's an issue that I'm going through right now... I'm getting numerous errors after trying to run handle_form.php script from Chapter 2: Notice: Undefined index: name in C:\xampp\htdocs\handle_form.php on line 27 Notice: Undefined index: email in C:\xampp\htdocs\handle_form.php on line 29 Notice: Undefined index: comments in C:\xampp\htdocs\handle_form.php on line 31 I went through Google Search and found out that I can suppress warnings by adding error_reporting(E_ALL ^ E_NOTICE); on top script. That, however, doesn't solve an issue - it just masks the problem. Any help would be appreciated!
×