Jump to content
Larry Ullman's Book Forums

jeffreader

Members
  • Posts

    26
  • Joined

  • Last visited

Everything posted by jeffreader

  1. I see that you did not help me so I had to type this: localhost/welcome.php that came out what it showed from the book on page 240 (. I will have to figure this out on page 242 later. I am moving on Chapter 9 this week.
  2. I am on page 240 (Chapter 8). My Login Form said that my email address and a password is not correct - I have to go back and try it again. So, what is the problem? (A) The login form... is fine. (C ) Login Form error is fine. (D) I don't see the result like "Welcome to the J.D. Salinger Fan Club!" due the email and password are not correct.
  3. For the footer.html: <!-- Script 8.12 - footer.html --> <!-- END CHANGEABLE CONTENT. --> </main> <foot container class="siteFooter"> <p>Design uses <a href="http://concisecss.com/">ConciseCSS Framework</a></p> <p class="float-right"><?php // Print the current data and time... // Set the timezone: date_default_timezone_set('America/New_York'); // Now print the date and time: print date('g:i a l F j'); ?></p> </footer> </body> </html><?php // Script 8.12 - footer.html #3 // Send the buffer to the browser and turn off buffering: ob_end_flush(); ?>
  4. Larry, I fixed my problem on page 234 and 235 because I put the Script 8.11 and 8.12 together in 8.11 (even in the past pages) that was not supposed to be that way. Now, these scripts are separated now. The result for the books.php looks good and proper setting (margins) except "Design uses Concise CSS Framework" and the date are still on the zero margin on the left side page. I cannot figure it out. I did not understand you which one should I execute the file such as login.php, register.php ,or index.php. You did not mention the books.php on page 236 which I finally found the right file that matched the picture in the book.
  5. I restarted my iMac today. My program for the register (8.9) seems to be working fine. I don't know why that happened. I am sorry that you do not have an iMac. I am kind of wish that you could test on both machines so that it would save our time and move on other programs. On page 231, I typed the incorrect email address on the Email Address box, and it showed me the red color box that tell me that I have to correct it. "Please enter an email address." That is good one. (It will not show "Please try it again.") So, I entered my own email address. Am I expecting to get the email? Beside, my Apple Mail and XAMPP work fine. Off subject, what should I put a code for the left margin? The sentences are on zero margin on the left side that need to move to maybe 10. I have the same problem with my programs. ....Please consider to add an edit icon on your word processor on the website so that I could fix my comments, pictures, and same thing for other people's comments, too.
  6. Administrator, On page 231 for the Registration Form, why it added for the password? This does not make a sense to me. 2nd question, I submitted the form on my Firefox browser (iMac). I do not receive the registration email in my email box after the submission. Then, I changed the address from admin@example.com to my email address in the source code (register.php). I did not get that registration email, too. The result came out with no error as the exact result on page 226 (not 231). In short, I ran the XAMPP as a server.
  7. Perfect! Many thanks! It's too bad that my CodeRunner does not show me the different color for the error statement if you know what I mean. I do not have a Sublime Text if it would show me the color error. Beside, I am not familiar with other software. i.e. Atom, Coda, etc. I have to protect my eyes from looking at the monitor for too long.
  8. I finally found the problem with a T_STRING. It's really really small error into a big error. Like this: Source: <?php// Script 8.9 - register.php /* This page lets people register for the site (in theory). */ It should be like this: <?php // Script 8.9 - register.php ( Space between <?php // ) OMG! Now, I have a question that might be easy for you to answer my problem. (Note: I forgot to add the email in code for the form so I added it.) On the screen form, there is a missing text box for Email Address:. Here is my source. Thanks.
  9. http://localhost/practice/forlogin/register.php My browser says with an error statement: "Parse error: syntax error, unexpected 'define' (T_STRING) in /Applications/XAMPP/xamppfiles/htdocs/practice/forlogin/register.php on line 5." My line for number 5: define('TITLE', 'Register'); Parse error means there is a problem with omission of semicolon or an imbalance of quotation marks, braces, or parentheses. (On page 65.) On the error statement, What is T_STRING? --------------------------------- Here is the source: <?php// Script 8.9 - register.php /* This page lets people register for the site (in theory). */ // Set the page title and include the header file: define('TITLE', 'Register'); include('templates/header.html'); // Print some introductory text: print '<h2>Registeration Form</h2> <p>Register so that you can take advantage of certain features like this, that, and the other thing.</p>'; // Check if the form has been submitted: if ($_SERVER['REQUEST_METHOD'] == 'POST') { $problem = false; // No problems so far. // Check for each value... if (empty($_POST['first_name'])) { $problem = true; print '<p class="text--error">Please enter your first name!</p>'; } if (empty($_POST['last_name'])) { $problem = true; print '<p class="text--error">Please enter your last name!</p>'; } if (empty($_POST['email'])) { $problem = true; print '<p class="text--error">Please enter your email address!</p>'; } if (empty($_POST['password1'])) { $problem = true; print '<p class="text--error">Please enter your a password!</p>'; } if ($_POST['password1'] != $_POST['password2']) { $problem = true; print '<p class="text--error">Your password did not match your confirmed password!</p>'; } if (!$problem) { // If there were not any problems... // Print a message: print '<p class="text--success">You are now registered!<br>Okay, you are not really registered but...</p>'; // Clear the posted values: $_POST = []; } else { // Forgot a field. print '<p class="text--error">Please try again!</p>'; } } // End of handle form IF. // Create the form: ?> <form action="register.php" method="post" class="form--inline"> <p><label for="first_name">First Name:</label><input type="text" name="first_name" size="20" value="<?php if (isset($_POST['first_name'])) { print htmlspecialchars($_POST['first_name']); } ?>"></p> <p><label for="last_name">Last Name:</label><input type="text" name="last_name" size="20" value="<?php if (isset($_POST['last_name'])) { print htmlspecialchars($_POST['last_name']); } ?>"></p> <p><label for='password1'>Password:</label><input type="password" name="password1" size="20" value="<?php if (isset($_POST['password1'])) { print htmlspecialchars($_POST['password1']); } ?>"></p> <p><label for='password2'>Confirm Password:</label><input type="password" name="password2" size="20" value="<?php if (isset($_POST['password2'])) { print htmlspecialchars($_POST['password2']); } ?>"></p> <p><input type="submit" name="submit" value="Register!" class="button--pill"></p> </form> <?php include('templates/footer.html'); // Need the footer. ?>
  10. On page 227, it says, "Save the file as register.php, place it in the proper directory on your PHP-enabled server, and test it in your browser (D) and (E). my iMac runs on XAMPP 7.0.13-1. Is that part of the PHP-enabled server? My Firefox browser stated, " Parse error: syntax error, unexpected 'define' (T_STRING) in /Applications/XAMPP/xamppfiles/htdocs/practice/forlogin/register.php on line 5." Am I supposed to put my files on a hosting website in order to activate the register.php? Line number 5 on my register.php is: "define('TITLE', 'Register'); Now, I'm lost.
  11. Where did you get the concise.min.css and masthead.css? Look on page 205 and read the number 12.
  12. Hi Larry, I created the folders like this. Does it look right to you? index/index.php index/css/template.html index/templates/footer.html index/templates/headers.html
  13. My template file: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-with,inital-scale=1.0"> <mega name="HandheldfFriendly" content="True"> <title>Raise High the Roof Beam!</title> <link rel="stylesheet" type="text/css" media="screen" href="css/concise.min.css" /> <link rel="stylesheet" type="text/css" media="screen" href="css/masthead.css" /> </head> <body> <header container class="siteHeader"> <div row> <h1 column=4 class="logo"><a href="index.php">Raise the Roof Beam!</a></h1> <nav column="8" class="nav"> <ul> <li><a href="books.php">Books</a></li> <li><a href="#">Stories</a></li> <li><a href="#">Quotes</a></li> <li><a href="login.php">Login</a></li> <li><a href="register.php">Register</a></li> </ul> </nav> </div> </header> <main container class="siteContent"> <!-- BEGIN CHANGEABLE CONTENT. --> <h2>Welcome to a J.D. Salinger Fan Club</h2> <p>lorem ipsum dolor sit amet, consecetur adipisicing elit, sed, do eisumod tempor incidendunt ut labore et dolore amgna aliqua. Ut enim ad minim venia, quis motrud exercitation ullamco laboris nisi ut aliquip ex ea comodo consequat. Duis aute irure dolor inreprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sin occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> <!-- END CHANGEABLE CONTENT. --> </main> <foot container class="siteFooter"> <p>Design uses <a href="http://concisecss.com/">ConciseCSS Framework</a></p> </footer> </body> </html>
  14. On page 205, my website does not look the same design as yours. What is the problem with mine?
  15. I can't fresh my mind. The var1 to var3 have different and also empty(). It is same thing for isset(). Actually, I thought that there is only one var that something to clear out for one example but it has three examples (i.e. var1, var2, var3). I am not sure why do I have to know about them.
  16. On page 128, Chapter 6: I am lost. Please rephrase it with plain English for me. I rather to wait to hear from you before I put that program on my CodeRunner.
  17. No, I typed it on my Firefox browser - http://localhost/practice/handle_post.php"as long as XAMPP is running. Then I entered this address and came up the statement errors on the browser - without seeing the form. On Script 5.1 was fine which is on page 94 because I see the form on my browser. Also on page 99, it was fine for both A and B in the pictures. On page 102, this is a problem. Maybe, there are two problems on line 17 and 20. (I saved the handle_post file for PHP and posting file for HTML.)
  18. On page 102 - Chapter 5, I submitted this handle_post.php and I get the error immediately. I do not know where is the problem in my source file. localhost/practice/handle_post.php Notice: Undefined index: first_name in /Applications/XAMPP/xamppfiles/htdocs/practice/handle_post.php on line 13 Notice: Undefined index: last_name in /Applications/XAMPP/xamppfiles/htdocs/practice/handle_post.php on line 14 Notice: Undefined index: posting in /Applications/XAMPP/xamppfiles/htdocs/practice/handle_post.php on line 15 Thank you, , for your posting: Here is my source: handle_post.php. <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Forum Posting</title> </head> <body> <?php // Script 5.3 - handling_post.php #2 /* This script receives five values from posting.html: first_name, last_name, email, posting, submit */ // Get the values from the $_POST array: $first_name = $_POST['first_name']; $last_name = $_POST['last_name']; $posting = nl2br($_POST['posting'], false); // Create a full name variable: $name = $first_name . ' ' . $last_name; // Print a message: print "<div>Thank you, $name, for your posting: <p>$posting</p></div>"; ?> </body> </html> In case you want to see this one for Forum Posting which is no problem in the previous page. posting.html: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Forum Posting</title> </head> <body> <!-- Script 5.1 - posting.html --> <div><p>Please complete this form to submit your posting:</p> <form action="handle_post.php" method="post"> <p>First Name: <input type="text" name="first_name" size="20"</p> <p>Last Name: <input type="text" name="last_name" size="20"</p> <p>Email Address: <input type="text" name="email" name="email" size="30"</p> <p>Posting: <textarea name="posting" rows="9" cols="30"> </textarea></p> <input type="submit" name="submit" value="Send My Posting"> </form> </div> </body> </html>
  19. Also, how can I turn on the display_errors on my iMac (macOS Sierra)? If I want to turn it off, what should I do next? Does it has to do with the Terminal? I am not familiar with the Terminal app.
  20. Oh well. I forgot to add " = " between name and "comments on line 28 (feedback.html) which is on page 51. This is how I get so mad because it does not tell me the specific error. I wasted my time to figure it out. I looked up my phpinfo.php... "display_errors => STDOUT => STDOUT" I have no idea what does that mean. I thought that it would say on or off (See page 63). ---- I am currently on page 70 - it does not show up a bold name. It showed up a normal text. What did I missed probably on line 22? Also, I am curious about the Greeting! Is it supposed to show up another bold Greeting! ? <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Greetings!</title> <style type="text/css"> .bold { font-weight: bolder; } </style> </head> <body> <?php // Script 3.7 - hello.php ini_set('display_errors', 1); // Let me learn my mistakes! error_reporting(E_ALL); // Show all possible problems! // This page should receive a name value in the URL. // Say "Hello": $name = $_GET['name']; print "<p>Hello, <span class=\"bold\">$name</span>!</p>"; ?> </body> </html>
  21. Please delete my post number 9. I found my error on my Feedback coding. Your forum - my post does not have a delete button feature.
  22. On page 61 and 64. I created two files for Script 3.3 and 3.4. My original result showed an error for Script 3.3 - The error stated: Undefined index... /handle_form.php on line 17. It is almost perfect result. So, I created the Script 3.4 below of two images - "2nd result with deleted code lines." The Script 3.4 looks perfect because I removed two code lines that eliminated the errors. However, I realized that the ini_set is supposed to show me the problem first. What is the problem or what did I missed in the coding? Please look at the two codings: http://brioservices.com/index2.html
  23. Hello Larry, First of all, I have an issue with two directories on my iMac. I created two folders which are "practice" and "My program files." Do you think that the XAMPP 7.0.13-1 confused with these directories? ...My XAMPP runs MySQL Database and Apaches Web Server but not ProFTPD. My friend from out of state told me that I put "practice" files in the Applications/XAMPP/xamppfiles/htdocs/practice. Is that normal? I put all original files in "My program files" folder because of your scripts such as Script 1.5 to Script 3.4... that I do not want them to be override. I do not have your email address but remember that I bought your book.
  24. I finally signed a hosting service in order for you to see my two images that I wanted to show you. Here is the link: http://brioservices.com (only two images on this link) The second picture that I don't understand why it asked me to download the handle_form.php. My book does not say about the download. I do not feel that I want to skip the chapter until it solves this problem first. I am sorry I have not read about the isset() and array_key_exits() yet because I am in the chapter 3 this time. I am currently use my CodeRunner to edit it. Any idea how to prevent this asking for the download? http://brioservices.com
  25. On page 59, this is exact what I wrote down on my CodeRunner and saved the "handle_form.php." This is what happened above the previous comment that has the errors. I also wrote down the exact code on feedback.html that came out fine which is on page 56. I don't understand the errors for this handle_form.php. Larry, Can you help me with that problem? This is "handle_form.php": <!DOCTYPE html> <html lang="en"> <head> <meta charest="utf-8"> <title>Feedback Form</title> </head> <body> <?php // Script 3.3 handle_form.php // This page receives the data from feedback.html. // It will receive: title, name, email, response, comments, and submit in $_POST. // Create shorthand versions of the variables: $title = $_POST['title']; $name = $_POST['name']; $response = $_POST['response']; $comments = $_POST['comments']; // Print the received data: print "<p>Thank you, $title $name, for your comments.</p> <p>You stated that you found this example to be '$response' and added:<br>$comments</p>"; ?> </body> </html> ------------------------------------------------------- ------------------------------------------------------- This is a "feedback.html": <!DOCTYPE html> <html lang="en"> <head> <meta charest="utf-8"> <title>Feedback Form</title> </head> <body> <!-- Script 3.2 - feedback.html --> <div><p>Please complete this form to submit your feedback:</p> <form action="handle_form.php" method="post"> <p>Name: <select name="title" required> <option value="Mr.">Mr.</option> <option value="Mrs.">Mrs.</option> <option value="Ms.">Ms.</option> </select> <input type="text" name="name" size="20" required></p> <p>Email Address: <input type="email" name="email" size="20" required></p> <p>Response: This is... <input type="radio" name="response" value="excellent" required> excellent <input type="radio" name="response" value="okay"> okay <input type="radio" name="response" value="boring"> boring</p> <p>Comments: <textarea name="comments" row="3" cols="30" required></textarea></p> <input type="submit" name="submit" value="Send My Feedback"> </form> </div> </body> </html>
×
×
  • Create New...