Jump to content
Larry Ullman's Book Forums

johannsnr

Members
  • Content Count

    20
  • Joined

  • Last visited

Everything posted by johannsnr

  1. Hi Vicky, you can accomplish this by implementing rewrite rules. When the user logs in successfully the rewrite rule will switch the site to https, similarly when she logs out the site reverts to http and your login session is destroyed.
  2. Since last I spent days playing around with COOKIES and SESSIONS, trying to break the system so to speak to teach myself. I understand it better now. PS The 25 sites are scaled down to 1, I almost gave up and then gave it another go and another and another and another..... Nearly ended in divorce, but in the end a bit of success. Changed a lot of code and a lot of trial and error. Learned that with web development it is ongoing changes and using feedback making small changes. Check it out http://7daygardens.com.au I'll appreciate critisism
  3. ok so I have opted to run a query in the php file separately, then I realized that if (rows) can equal to 2, if for instance an email and mobile was found in the table. In both instances if a record was found I simply did not add the record and only retrieved a customer_id to be used later. I am concerned a little with security from that perspective.
  4. Why cannot I enter more than 127 items as quantity in the cart. I have tried and changed quantity in carts table from tinyint to smallint and that does not help. The maximum quantity of one item that can be selected is 127.
  5. The procedure add_customer on the coffee site simply adds a new customer to the table without checking if the current customer isn't already in the database. Is there a way to prevent duplicate customer records and how would the code change for example if (mysqli_num_rows($r) == 0) { call add_customer} if (mysqli_num_rows($r) == 1) { //thus the customer is in database and cannot be added again use information in database}
  6. Hi Larry, Thanks for your reply. I struggled with the code for another 24hours and then decided to chuck the original cookie code. I also changed my server to redirect www.example.com to example.com as the server read served both and the site configuration is only example.com. Even with the server configuration changed the original code still did not work correctly. Then the PHPSESSID cookie as in the original code I could not get to work so I changed the code as follows //check for session if (isset($_SESSION['user']) && (strlen($_SESSION['user']) === 32)) { $uid = $_SES
  7. Hi Larry I have to a point given up on understanding what the problem is because the code simply don't work. I have spent more than a week 14 to 16 hours a day trying to figure out where the problem is and I got nowhere. Looks like using cookies and sessions in browsers are just impossible and the results are never what you expect. Another way should be found! I have tried changing the code to something simple like just returning the session id and that does not even work, so I have no clue where to go from here which means my whole website project is in the water, together with my busin
  8. I am very disappointed in this forum which is supposed to be to help with question. I have posted on this topic more than once asking for help with not a single response from the writer. I have bought no less than 5 of your books, Larry and now I am struggling with no response from you. Perhaps it is time for me to seek another writer. I am sure I am making a beginner mistake but need a little help in finding the solution. Your response will be greatly appreciated.
  9. A little help would be appreciated on this problem, please. I had another stab at it and as far as I can figure out is that at the start of pages leading up to billing.php somewhere I have a problem. That is that, I think there is a problem in the code in the way I display the products where a customer can select a product and add it to his cart. Reason I figured is if I add a product to a cart everything works until I proceed to checkout, but if I update quantities before checkout it works fine. Hope my explanation makes sense. Please anyone??
  10. This morning the problem is back. Could anyone perhaps give some insight to this problem, because it does not make any sense whatsoever.
  11. found the culprit, but don't understand why. In cart.php on line 17 // Send the cookie: setcookie('SESSION', $uid, time()+(60*60*24*30), '/' ); and changed it to // Send the cookie: setcookie('SESSION', $uid, time()+(60*60*24*30)); which solved the problem, if I add my domain nothing works. Larry maybe you can shed some light here. Am I making a noob mistake or am I missing something from php.ini because my path is set to root in php for cookies.
  12. I have built and tested more than one website using Larry's model and the new site was working to a point, I think up to billing.php and then it stopped. If I remember correctly there was a update from Microsoft for edge, but I have tried the website in Firefox and Chrome with the same problem. I have a running server with Ubuntu and Nginx. It does create the sessions just not the same one, so for every php file and view page a different session is created and when you close the browser, delete history and cookies and then open the browser again it will bring up the original cookie up to car
  13. Hi I am having trouble with setcookie and php sessions. In the file cart.php it creates or checks for a cookie. That works fine and I can find the same cookie id in phpmyadmin in carts table. The problem is when I click on 'checkout' the next page shows emptycart.html and redirect to cart.php. In the browser a new cookie id was generated and sometimes a new phpsession as well that does not match up with the cookie id in carts table. HELP!
  14. Hi Everyone, After struggling for some fare amount of time with this I have found that the AuthorizeNet.php should be replaced with autoload.php found in the anet_php_sdk folder. In billing.php on line 158 where it is asking for ./AuthorizeNet.php it should point to ./autoload.php. Once I did that I had to change my php configuration to allow for the function curl_init() to be active. Remove the ; in front of extension = php_curl.dll (line 883 on my installation of php.ini). After that the system asked for class zend mime part. in email_receipt.php. I commented out lines 64 to 98
  15. Hi Everyone I am struggling with the same issue. The AuthorizeNet.php file is missing in the download. There is however a file under the LIB folder AthorizeNetAIM.php. Unfortunately using this file creates another error which relates to a class AuthorizeNetRequest which it cannot find (line 42 in the script) AuthorizeNet website does not really offer much in terms of a solution either. Anybody got any idea how to fix this? regards johannsnr
  16. I received errors regarding scripts related to times and dates. I added the following script in the config.inc.php in the 2nd ecommerce site <?php date_default_timezone_set("your_timezone"); echo date ("Y/m/d H:i:s"); ?> this solved the re-occurring errors
  17. Hi Larry I have found an error in the .htaccess file of /ex2/html in the 2nd ecommerce site. There is a added slash in the code. RewriteRule ^shop/sales/?$ /sales.php Correct me if I'm wrong, so the extra slash is added in the URL and obviously the file then does not exist. Removing the slash in the code resolved the issue.
  18. Hi Larry, I have a similar problem as Cclear wrote. My problem though starts with the sales link and I have checked my .htaccess file which is correct(or so it seems). The link to Sales just don't want to link up for some reason. I have tried to simplify the linking files only to include a header and that doesn't work either. So I am stuck with that the problem lies within the .htaccess file, but why would browse and shop work fine and not sales.
  19. maybe I was a bit unclear here. Instead of having products displayed as below product 1 price 1 quantity product 2 price 2 quantity product 3 price 3 quantity I am trying to display as follows product 1 product 2 product 3 price 1 price 2 price 3 The problem is creating the rows in a table, because each row represents different products with different product id's in the DB table
  20. Hi Larry I am trying to display my database products as thumbnails instead of listing them below each other and am struggling with the php code to do this. Could you perhaps assist with some ideas.
×
×
  • Create New...