Jump to content
Larry Ullman's Book Forums

All Activity

This stream auto-updates

  1. Yesterday
  2. Last week
  3. Okay, so the code is the same as in the book and the library is roughly the same and the code examples in GitHub are roughly the same. This is going to be hard to debug! My inclination is that either the library doesn't work on HTTP or it has something to do with the sandbox. I would first log into Authorize.net and see if I can view the requests being made. First check that the requests are getting there. Then, if so, check that the requests are receiving the CC dummy values.
  4. Looking at it again, I think it's the same version that you are using, but just a different link. It's version 1.1.8
  5. Hi Larry, I am using the following version which can be found at: https://github.com/objco/anet_php_sdk It's called anet_php_sdk-master The reason I am using this version is because the link developer.authorize.net/downloads where you said we could download the version you are using on page 325, is obsolete, so I had no choice but to find another link where there was another version. I believe I am using a slightly different version from the one you are using. regards
  6. Hmmm...it's been a long while since I've looked at this code. What version of the Authorize.NET PHP library are you using? This could be a change in their library since the book was written.
  7. Upon further research, the problem happens in the billing.php page, specifically at the line: $response = $aim->authorizeOnly(); All my entered values are entered correctly, but when the following class is called in the 'anet_php_sdk' folder: class AuthorizeNetAIM extends AuthorizeNetRequest() and then the following method inside the class is called: public function authorizeOnly($amount = false, $card_num = false, $exp_date = false) { ($amount ? $this->amount = $amount : null); ($card_num ? $this->card_num = $card_num :
  8. Hi Larry, Hope you are well. I have hit a brick wall on page 336 on Effortless Ecommerce 2nd edition. I have written all the code up to this point. The only modification I have made is changing the urls beginning with 'https' to 'http' in the billing.php page eg: $location = 'https://' . BASE_URL . 'checkout.php'; to $location = 'http://' . BASE_URL . 'checkout.php'; and $location = 'http://' . BASE_URL . 'final.php'; to $location = '/final.php'; These are temporary adjustments because I don't have
  9. Earlier
  10. Hi Larry, Thanks for your response. Very much appreciated.
  11. Hmmm...this can be tricky. I'd start by re-evaluating whether it's really necessary to enable SSL on your Mac. Eventually I stopped bothering (I was never using real data that needed to be protected and since it's localhost, the data isn't leaving my computer regardless). But if you do want to continue the first trick is to figure out exactly why Apache doesn't like those settings. I normally start with Apache's "configtest" command, but you'll need to run that using MAMP's Apache. For the Mac's primary Apache you'd run `apachectl configtest`. Unfortunately I don't know what the properly
  12. Hi Larry, Hope you are well. I am having serious problems trying to implement a ssl certificate in order to test the https://localhost/checkout.php page in chapter 10. I am using a macbook pro, and using mamp. I tried created all the necessary files needed to to generate the certificate, but my problem starts when i try and edit the httpd.conf and http-ssl.conf files. In the httpd.conf file i have the following settings: Listen 8888 ServerName localhost:8888 Include /Applications/MAMP/conf/apache/extra/httpd-ssl.conf In my httpd-ssl.co
  13. Unfortunately I'm not familiar with VSC 2019 and its PHP support. Or what it means to Live View a PHP file in it. Hopefully someone else might know and post an answer, or an internet search turns up the solution.
  14. I am using VSC 2019 and PHP 7; when I Live View an HTML file I have no problem. When I try to Live View a PHP file I get the following message: Cannot GET /%20--use-spdy=off%20--disable-http2 I had no issues with the install of either Vs or PHP and verified my PHP is running correctly. I need a little guidance please.
  15. Hey Vikky! To implement a coupon system, you'd want to start by creating a coupon table. A coupon would have a code, probably an expiration date, and then either be a percent off or a fixed-amount off. In more sophisticated systems, coupons may only apply to certain items or total order amount, etc. You may also want to track coupon usage. Then, as part of the checkout process, you'd need to add a field to accept a coupon. Your programming logic would need to verify that the coupon is valid, and adjust the order total accordingly. You'd want to update your orders table in the database to
  16. Hey! You're having this problem because PHP runs on the server, which means all of your PHP code has already been executed before you see the HTML page in the browser. Secondarily, your button as written doesn't actually do anything. There's no programming logic attached to it. That would require JavaScript, which runs in the client.
  17. I am new at php. I am trying to loop a number in each click of a button. See attached picture for reference. 1 should iterate after the click of the button and will stop to iterate when it gets to 5. Here is my code: <!DOCTYPE html> <html> <body> <div>Question <?php $num = 5; $n = 1; $n <= $num; echo $n; ?> of <?php echo $num;?></div> <form method="post"> <button id="button" class="button" value="add" name="add">Click</button> </form> </body> </html>
  18. Hi Greetings, Sir thank you for all the teaching and guidance and lots of appreciation for all the colleagues. Sir how can I implement coupon system in the second site as available in the popular sites ?
  19. Good question! First, I guess I'd say that if having too many database records might be a problem, you probably want to rethink your hosting situation. The space used by fake records should be one of the furthest things from your mind, ideally. I imagine my forums has 1,000-2,000 fake registrations. That being said, you can just run delete queries to remove fake registrations on a manual schedule of your choosing. But it's probably worth trying to implement a couple of things to prevent fake registrations in the first place (reCAPTCHA and then some).
  20. How do we easily get rid of people who register but do not activate their account? I just found out that I cannot schedule an event in the database because I am on a shared web hosting plan. I am seemingly getting a lot of "fake" registrants that are taking up space.
  21. Dear all, Please can anyone help, I am writing a code for updating one or all the 3 images in my product page but the query was not running, The below is the code I am trying to work on and I think is the line one that is causing the issue but I don't know what to do. if(is_uploaded_file($_FILES['file']['tmp_name'])){ // work for upload / update image $product_img1 = $_FILES['product_img1']['name']; $product_img2 = $_FILES['product_img2']['name']; $product_img3 = $_FILES['product_img3']['name']; $
  22. Thanks for your questions and for your interest in the book. I appreciate it! Yes, I think the 5th edition would still be a fine way to learn PHP. It was written using PHP 7.0.6. The current stable version is 7.4.11. I'm not aware of any deprecated code, but I also haven't written a guide for that. Most of the feature changes that have come along are in the more advanced and esoteric areas of the language. Yes, this book is designed to be an entry into the PHP and MySQL book. Yes, forum posts can be pinned to the top of the list. Let me know if you have any additional q
  23. Tried in more simplified and straightforward way. $(document).ready(function() { $('select').on('change',function() { var returnVal = $(this).val(); var curRow = $(this).closest('tr'); curRow.find('td:eq(5)').text(returnVal); }); // end change }); // end ready Reminds me of studying a book years ago where "chaining" seemed so complicated that in order to understand an example you had to work your way back through the chain to understand. My mind back then was not set up for chaining. But I did remember a solution had a certain level of elegance which shows there is a way.
  24. Is PHP for the Web: Visual QuickStart Guide (5th Edition) still a good place to start learning PHP? and.. What version of PHP is used in the book vs the most recent stable release? Is there a guide to deprecated code that exists in the book - for example functions that might have been replaced with something more efficient/secure that is posted on the forums? Is this book a good foundation/pathway towards your other book PHP and MySQL (5th Edition)? (*I've owned both for some time so I'll most likely be starting with the former) Are forum posts here able to be stickified to
  25. To try something else. <script type="text/javascript"> $(document).ready(function() { $('select').on('change',function() { var returnVal = $(this).val(); $(this).parent('td: eq(6)').text(returnVal); }); // end change }); // end ready </script> Doesn't work. $(this) represents the selection from a list which we know works. Parent() should be theoretically the containing row. If successfully displayed a button could be included to accept/submit and another function could update the database.
  26. Since its a test a step by step procedure prevents me from biting off more than I can chew and some of the steps would be unnecessary in the final version anyway. When you're figuring something out the first time it pays to be cautious. The concern is that the event is precipitated from a selection within one of the table row's columns as in a lower level. But if looking for the current row, the jQuery search goes upward from the current location which is the way the event is set up here without using "parent" because "current row" might be more straightforward. It seemed more common sense
  1. Load more activity
  • Create New...