Jump to content
Larry Ullman's Book Forums

Robert

Members
  • Posts

    7
  • Joined

  • Last visited

Robert's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. And, of course, you got that right. I have 'discovered just what was the fault or at least what is needed for 'things' to function as planned. Changing <form action="handle_form.php" method="post"> to now <form action="http://localhost/handle_form.php" method="post"> is what is necessary to 'get things to work'. This is no doubt to suggest that the file handle_form.php is to be 'given to the server' who then passes it onto MSIE. Of course, MS IIS7 already knows what it need to know about PHP5. This is to suggest all applications (on this learning about it system) will require <form action="http://localhost/(some .php file)" to be used. Also, somewhere I did read about the use of 'single quotes' as well as "double quotes". I do believe this is of some importance, just another detail on this path of a wonder through the forest of trees on knowing things.
  2. If MS MySql was not installed and working along with PHP5 both of which is necessary for Wordpress to also be installed and also working, then the simple thing could be try XAMPP. Except, wordpress is installed and 'things are working', Microsoft IIS7 is installed and working. Even the most simple task, a simple 1 element form cannot seem to POST one variable onto a second .php page.
  3. <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="gender" 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> does not load into MSIE passing the variables from form.html into handle_form.php but opens this file in the clipboard. Yet, when handle_form.php is resident in the editor, clicking preview tab or preview in button on the tool bar the handle_form.php does execute the php code but no variables are passed from form.html. What is of great importance is a 'complete understanding of this <form action="handle_form.php" method="post"> HTML method as the prime objective will be close work with MySQL.
  4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.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="gender" 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> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> <title>Form Feedback</title> <style type="text/css" title="text/css" media="all"> .error { font-weight: bold; color: #C00; } </style> </head> <body> <?php # Script 2.5 - handle_form.php #4 // Print the submitted information: if ( !empty($_POST['name']) && !empty($_POST['comments']) && !empty($_POST['email']) ) { echo "<p>Thank you, <b>{$_POST['name']}</b>, for the following comments:<br /> <tt>{$_POST['comments']}</tt></p> <p>We will reply to you at <i>{$_POST['email']}</i>.</p>\n"; } else { // Missing form value. echo '<p class="error">Please go back and fill out the form again.</p>'; } ?> </body> </html> Both of these files are moved/copied from 'their unziped' location over into the C:\inetpub\wwwroot directory.
  5. Greetings, great book and I plan to 'slowly work my way' through each page. My first 'road block' has occured with the scripts 'form.html' and 'handle_form.php'. The HTML and PHP editor is Rapid PHP 2007, the Dell Laptop, Windows Vista Business, IIS7 is installed and working, PHP5 installed and working. The info.php file with the script <?php phpinfo(); ?> in line #1 works, either from the Rapid PHP 2007 editor of when double clicking the file will 'find the server', loads the file into the MSIE and does work. When the file 'handle_form.php' is resident in the Rapid PHP 2007, previewing this fifle in MSIE, the script works except no variables have been passed from 'form.html'. 'form.html' does work and 'the problem' is passing data into 'handle_form.php'. This file is not loaded into MSIE but the message is to open this file into the clipboard. Thus, I am not too sure what 'my problem' is. It seems and use of the HTML code <form action="handle_form.php" method="post"> will not 'load the form' in to MSIE, but will open this file into the clipboard. This 'road block, speed bump' in getting on with things is quite firm. Not good.
  6. Thanks much, works like a charm. This will certainly save keyboard, keycaps and 'those typo' errors that might occur.
  7. There is ‘some problem’ with the zip file as after placing this file in a folder, double click to unzip, the message is “Windows cannot open the file. The Compressed (zipped) Folder ‘C:\phpCode\phpmysql3\phpmysql3_scripts.zip’ is invalid. Not too sure about this, imagine this is ‘a problem’ on this end of the Internet. Then again, maybe not.
×
×
  • Create New...