Jump to content
Larry Ullman's Book Forums

eonfloyde

Members
  • Content Count

    14
  • Joined

  • Last visited

Community Reputation

0 Neutral

About eonfloyde

  • Rank
    Newbie
  1. A little confused, sorry... After looking at the above closer I am thinking my way may be easier to add or subtract from the menu that isn't part of the drop down? I use an 'if' to choose the array in which to dynamically create the main links (not via drop down menu). Can you explain where you would add this code to my original? I see only the drop down menu portion as a option. If I am not mistaken the original code is dynamically creating the links (main menu portion) from the $pages array? I could add register to the drop down portion, but for usability I think I would like it m
  2. I Think your way is easier and better, but I did not think of that. I finally got it to work this way. But it sure is a lot less code via your example. Thank you very much for your reply. It took me some time to figure this out. I should keep the KISS method in mind from now on. :-) -eon-
  3. Oh shoot I did it this way. Which is better practice? <?php // Dynamically create header menus. // Array of labels and pages (without extensions): // Show or hide register.php link if user is logged in via session data: if (!isset($_SESSION['user_id'])){ $pages = array ( 'Home' => 'index.php', 'About' => '#', 'Contact' => '#', 'Register' => 'register.php' ); }else{ $pages = array( 'Home' => 'index.php', 'About' => '#', 'Contact' => '#' ); }
  4. Question: I have never created a menu system dynamically. I can not figure out how to hide() the register tab if a user is logged in. I am unsure where to start in the header file to do so. Near the bottom of the code is where we decide if we should show the log in page within the index page. I figure I would have to start there, or change the dynamic code to check for this first? I'm such a newbie... LOL Any help, or ideas would be most appreciated. Thank you, The Code: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> &l
  5. Thank you for your post! This has helped me to understand better what may have happened. I had zero problem logging in, adding pages. However, as you point out I did have an issue when trying to view the pages. I was told that I had to renew (that I had expired). (BTW - this is in relation to login.inc.php line 52 which affects category.php line 35) However, what I did was change the comparison operator form === to == and problem fixed. I am unsure what PHP is returning, and unsure if each version is returning something different. The PHP manual says: $a == $b Equal TRUE if $a is
  6. Question: I have never created a menu system dynamically. I can not figure out how to hide() the register tab if a user is logged in. I am unsure where to start in the header file to do so. Near the bottom of the code is where we decide if we should show the log in page within the index page. I figure I would have to start there, or change the dynamic code to check for this first? I'm such a newbie... LOL Any help, or ideas would be most appreciated. Thank you, The Code: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> &l
  7. Larry, Loving the book!! Your a genius.. :-) I just wanted to say that in my book (Effortless E-Commerce: second edition) on page 93-94 just before the we create the "IF" to determine whether the email, or username is at fault when validating the script. Line 127 of your supplied code shows an "ELSE" before the "IF" on line 129, which the book does not. I checked the books forum for an errata but none exists. I don't know if this will help anyone, but it did me as my code would not validate the culprit (username, or email, or both). This may help those following along codin
  8. Sorry, I forgot to list my versions: PHP 5.5.14 MySQL 5.5.38 OSX 10.9.4 In addition this is all I could find on the subject. Can't say I completely understand if this will hurt the way the database will function for future chapters. MySQL auto initialises TIMESTAMP Columns with DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, so your first column TIME has the CURRENT_TIMESTAMP Added as default. Therefore by the time you explicitly add a DEFAULT to a column one already exists. You either need to change the order your columns are defined: CREATE TABLE `silas`
  9. no sir, I am talking about PHP and MySQL for dynamic websites fourth edition.
  10. I am really enjoying your books. They focus on may concerns for todays systems. Especially security. Thanks for taking the time to write them. I finished PHP and MySQL for dynamic web sites. I found great information throughout that title. I have now started this book (effortless eCommerce 2nd ed.), which is very intriguing. I started the book, and ran into a strange issue. The very first SQL script failed on 'users' table. The exception I received; 16:24:57 CREATE TABLE `users` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `type` ENUM('member','admin') NOT NULL DEFAUL
  11. That makes sense, I'll get it... Thank you for answering my previous question. Now a poetncially really stupid question: I see page 473-478 we use javascript to control the pages error handling. We use calculator.html, calculator.js, and calculator.php (and a new version of the css document). I am very curious how this works. I can test to see that javascript is handling the new error reporting because the errors show up on the page (no alert window). This thwarts the calculator.php page attempt at handling the errors because we use false to prevent actual form submission. However, wh
  12. I need some help on Chapter 13 Review and pursue. Instead of posting a new topic I thought I place it here. Page 432 the last "Pursue" challenge: "Apply the Fileinfo extension to the show_image.php script from Chapter 11". I can not figure out how to do this. I have only been using the original script. I do not see how to use the resource (file info) once created. I believe I need to apply this resource to $name = $_GET['image'], but am unsure how this would work as this is a function, and the show_image.php is a script that images.php validates from. Any ideas on how to pu
  13. Okay.. After several attempts to figure out the issue with this script the problem was basic syntax, and mail server postfix issue using MAMP 3.0. Specifically, my XHTML was missing the " = " for method = "post" within the form element. After reviewing the debugging steps in chapter 8, and using other sources of information, the script is now functional. The issue with MAMP PRO; because the syntax problem within the XHTML the script simply did not execute. I received no errors, and was not able to use 'echo' statements for debugging because the script never ran. I focused t
  14. Larry, I love your books, I have learned more from them than I did from actual classes... LOL Thank you for taking the time to help us out when we run into problems. I appreciate your knowledge. Please excuse my way of asking questions, as I am new and find it a bit difficult to make sense of it all. I am new to PHP. I can build static sites, but PHP syntax messes with me; even my HTML at times.. I am having a heck of a time figuring out why Chapter 11 : Script 11.1 will not function. I have read many forums, searching out possible causes. The script displays, will run, but n
×
×
  • Create New...