Jump to content
Larry Ullman's Book Forums


  • Content Count

  • Joined

  • Last visited

Everything posted by hartofboone

  1. Hi Larry, Just want to say thanks for your help in the past. I wasn't really expecting the author to answer questions, lol! I have both the first and second site coded and working (well, except for SSL checkout issue in ex2). However I can't even get the first update in Chapter 12 to ex1 working! Our teacher assigned both chapters 12 and 13 this week for class and I don't see that happening with the problems I'm having getting through just the first part of chapter 12! I personally work better off seeing working code. Do you have a working page.php from chapter 5 (starting on page 130
  2. Chapter 11 sets up an admin interface to populate the database. The menus that return no products are working, just the database hasn't been populated yet is what i found out with my pages above. Speaking of Chapter 11: I pulled the admin subdirectory back up one directory leve so it is even with the html subdirectory. Got it coded up similar to the html subdirectory. The mysql.ini.php for example I only had to change html to admin in the BASE_URL to get stuff working. For some pages I did have to walk up one directory and down the html subdirectory to get to the .js or .css or images
  3. Hi Larry, Pretty much got all my links working, got .htaccess and mod_rewrites on Apache working, got images loading, got css working but I was wondering why some data from the database is being returned while other data in the same table and page returns nothing. It's probably easier to just show the pages and see if you have any suggestions. Here is my Coffee page: If I select Dark Roast nothing is returned from the database and it loads the error page: If I choose Kona it appears to pull data from the database and work. Don't understand why one works
  4. I'm running XAMPP on my pc and I foundout that the httpd.conf for Apache needs to be edited and have "AllowOverride none" changed to "AllowOverride All" for the mod_rewrite to work. Then test to see if your .htaccess is working. To do that add something like RewriteRule ^test.php index.php in the .htaccess file.
  5. Hi Larry, Yep, It's 1am and I'm still working on Chapter 7-9 of your book. In the book you said you don't need to use mod_rewrites and you would tell use how. I don't see how listed for anything other than the menu links: Chapter 8, page 232 As a reminder, the PHP script for listing the product categories is called shop.php, and it’s linked in the header as either /shop/coffee/ or /shop/goodies/. The server’s mod_rewrite module will convert that URL (unbeknownst to the user) into either shop.php?type=coffee or shop.php?type=goodies. If you’re not using mod_rewrite, then your URLs should jus
  6. I fixed two errors with my add_pdf.php upload to MySQL database tonight! My environment is both localhost using XAMPP and a school Wake Tech server. First problem. I was getting an error message something about can initialize fileinfo(). Found out that the php.ini need the comment removed in front of the following line: extension=php_fileinfo.dll Restarted the apache server after the change and add_pdf.php works now. Second problem. On school server I was getting a different message. Big long error message that dropped to line 141 and said I had a system error. Error messa
  7. I had the same problem with the undefined function finfo_open() when I tried to upload a pdf. I'm running XAMPP. To fix it I edited the main php.ini. Remove the comment from the following extension and restart the apache server to enable the fileinfo extension extension=php_fileinfo.dll
  8. Yea! You nailed it on the first try. Thanks for spending time looking over my code! I've been taking classes at the community college for 4 years (part time) while working full time and this is the first class I've had problems with. Thanks for the fix!!!!!!! Category was trying to use array to pick up multiple categories and was dying. So, for anyone else here is what I did to go back to picking a single category and have the add_page.php work again: Comment out the following lines in add_page.php to stop category trying to use an array: echo '"><label for="category" class="co
  9. Hi Larry! Sorry, no idea what the value for category is. I'm a student. I'm not running an ide where I can trace stuff like in C++, just a text editor. Not sure how to run a trace for string or array variables in PHP. I tried to echo and print out the value of category but since it's an array value I get a you can't print out a string value from an array. Looked here also: http://stackoverflow.com/questions/4383914/how-to-get-single-value-from-php-array but not sure if that would work or what to plug in. Any suggestion is helpful. As I said before if I remove the category validation s
  10. Well, it's 3 days later and still no idea why your code isn't working. It's looking for an index called category when there isn't one. 8. Validate the category: if (filter_var($_POST[‘category'], FILTER_VALIDATE_INT, -array('min_range' => 1))) { $cat = $_POST[‘category']; } else { // No category selected. $add_page_errors['category'] = 'Please select a category!'; } Here is the sql.sql we are running the add_page.php against: -- -- Table structure for table `categories` -- CREATE TABLE `categories` ( `id` SMALLINT NOT NULL AUTO_INCREMENT, `category` VARCHAR(30)
  11. I'm having problems figuring out how to fix my "category not found error" on my add_page.php. This is a repost I believe of the same error Posted 25 February 2016 - 9:39 PM. Here is book code: 8. Validate the category: if (filter_var($_POST[‘category’], FILTER_VALIDATE_INT, array(‘min_range’ => 1))) { $cat = $_POST[‘category’]; } else { // No category selected. $add_page_errors[‘category’] = ‘Please select a category!’; } Each HTML page is in a single category. That association is made by attaching to each page record a foreign key to the proper value in the categories table. To conf
  • Create New...