Jump to content
Larry Ullman's Book Forums


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by Johnamc328

  1. If it was just me I would say it is some weird fluke. But another user stated the same issue. Must be something on the back end somewhere if you took my code and it worked fine in your envrioment. I am doing this at work - I will try it at home and see what happens.
  2. I have tried it with IIS and Bitnami WAMP with the same result
  3. I tried to with my GoDaddy account but they have too many issues. Here is the source code of the page after it has ran <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content=""> <meta name="author" content=""> <title>Add a Site Content Page</title> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <!-- Bootstrap core CSS --> <link href
  4. I put the code just below the category section and this displayed Array ( [status] => draft [title] => Text [category] => Array ( [0] => 5 ) [description] => Text [content] => Text [submit_button] => Add This Page ) Have tried with IE - Firefox and Chrome - all latest versions
  5. The main problem is I am not able to select one of them - I try but always get this message - I changed it to 1 instead of 5 but i still can not select one
  6. Here is the code that pertains to the dropdown echo '"><label for="category" class="control-label">Category</label> <select name="category[]" class="form-control" multiple size="5">'; // Retrieve all the categories and add to the pull-down menu: $q = "SELECT id, category FROM categories ORDER BY category ASC"; $r = mysqli_query($dbc, $q); while ($row = mysqli_fetch_array($r, MYSQLI_NUM)) { echo "<option value=\"$row[0]\""; // Check for stickyness: if (isset($_POST['category']) && ($_POST['category'] == $row[0]) ) echo ' selected="selected"';
  7. Here is a screen shot - I am using the code from the book. I can't figure out why the Category will not do a drop down - the database connection is fine.
  8. True and I tried that but it did not make the drop down display so I though I was missing something with a relationship between two tables. I get just a textbox where it is supposed to be a drop down
  9. The first edition book file populates the table - not the ones with the second edition sql file - thanks for pointing me in that direction Even with the table filled the Categories is not a dropbox but a textbox - this line is different from the example select name="category[]"
  10. Yes local setup and using IIS and WAMP - here is all that the sql file has - just the tables creation CREATE TABLE `categories` ( `id` SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT, `category` VARCHAR(45) NOT NULL, PRIMARY KEY (`id`), UNIQUE INDEX `category_UNIQUE` (`category` ASC) ) ENGINE = InnoDB DEFAULT CHARSET=utf8; I will try another DL and see what I get
  11. I apologise if I have missed something but the SQL statement that came with the download created the tables but did not populate the categories table. I try the add_page.php and it errors out because there is no data in the table. I have read through the chapter for the last 2 hours and can't find anything that populates the table but does refer to it such as this 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. Where does the data for the categories table come from? Thanks,
  12. I have found that when you use IIS and try the exercise with WAMP, LAMP etc is that you have default port settings for mysqli commands. If you are running IIS then those default ports are taken. If you are running a WAMP you have to go into the PHP inside the WAMP (IIS php is the regular php install) and change the port settings to the ones you selected when you installed WAMP. For example default ports are 80, 3306 and 443 - With a WAMP install most people choose 8080, 3307 and 4443 - in the php.ini you have to set the mysqli to 3307 instead of 3306 or the mysqli command to connect to t
  13. I have been going through each chapter - the db is fine - the registration process works. Trying to figure out the IIS - includes problem since it is always with an included file where the trouble starts.
  14. So are the source files that are downloaded complete or do they still need modifying? I added the function to login.inc.php and it does not throw an error. It takes me to the home page. Then I put in a bogus email and it took me to the home page with no errors displayed. I entered a bogus PW and it took me to the home page with no errors displayed. It does not seem to be catching the errors - the register.php works fine with error checking, registering etc. Not sure why these include files are not catching errors.
  15. Hello, I have given up on Godaddy and WAMP. I am back to windows and IIS. I seem to be having a problem with the session since I always have the display showing Admin selections when I am classified as a user. I click on logout and they do go away. I click on the Home tab and they come back. I try the login and I get this error Fatal error: Call to undefined function escape_data() in C:\inetpub\wwwroot\ecommerce2\includes\login.inc.php on line 12 Any ideas are appreciated
  16. Something with phpmyAdmin - connection works fine with IIS connect - same settings
  17. I installed Bitnami WAMP - when it tries to connect to MySQL it bombs on this line mysqli_set_charset($dbc, 'utf8'); it gives this error mysqli_set_charset() expects parameter 1 to be mysqli, boolean given I googled it but can't find any current info - it did work fine under IIS
  18. I am going to install WAMP Stack - it may clear up some of these problems
  19. Someone brought this up - will the php code be seen if the extention is .html? That would explain why
  20. Hi Larry, Yes I am pretty familiar with PHP and MySQL - I have never got into the e-commerce portion before. Many other tutorials I have done do not have code in the header so that is why I am experiencing that now. I am developing locally and on GoDaddy at the same time just to see if it is possible to create a system for someone in the future. I am pretty sure that it is some issue with IIS. The Godaddy person said I should learn Linux but I am a little old to go down that road. I will updated when I have a solution.
  21. Upgraded back to 5.4 which is the highest Godaddy has - waiting on tech support since it bombs certain pages.
  22. I followed the wrong link from an earlier question about the same thing. I made the changes and here is what I have require "lib/password.php"; $hash = password_hash($password, PASSWORD_BCRYPT); An error occurred in script '\html\ecommerce2\register.php' on line 94: Undefined variable: password I have found out that I am having a problem with my IIS 7.5 - It will not see "require" - I am still trouble shooting to get the IIS correct. I will post my finding for future reference. Thanks
  23. Hello, I successfully logged out and tried to login. When I click to login it brings me to the default index.asp page with a "The website cannot display the page". When I just click on login without the email or PW it takes me to the default index.php page with no problems. The registration worked with no problems. The admin sections are not checking if I am an admin since the add pdf and add page sections show up with no problems and I have not set anyone up as an admin. These "require" as opposed to "includes" seem to not work with IIS - is there some setting I need to check?
  24. Hi Larry, Godaddy is at 5.4 but the site would not work until I reverted it back to 5.3. This is the link I found from another comment here https://sunnyis.me/blog/secure-passwords
  • Create New...