Jump to content
Larry Ullman's Book Forums

Necuima

Members
  • Content Count

    338
  • Joined

  • Last visited

  • Days Won

    5

Necuima last won the day on June 13 2017

Necuima had the most liked content!

Community Reputation

15 Good

About Necuima

  • Rank
    Advanced Member

Recent Profile Visitors

1200 profile views
  1. There is also a similar example in detail using jQuery in the book "JQuery in Action, 2nd Edition" chapter 8.
  2. OK, I'll use the timestamp approach. Thanks for the advice. Cheers, Necuima
  3. Hi Larry, I finally got to the point in my complete software re-load/re-build where I could test your suggestion. I re-downloaded the script from your website and made the suggested change but unfortunately I am still getting the error "on line 29: session_write_close(): Session callback expects true/false return". Here is my modified code: // Define the close_session() function: // This function takes no arguments. // This function closes the database connection. function close_session() { global $sdbc; mysqli_close($sdbc); return true; // return mysqli_close($sdbc); } // End of close_session() function. My environment is XAMPP 7.3.5 with PHP 7.3.5 both 64 bit under Windows 10 (64 bit). I know that you are a very busy man so please treat this as low priority - I will use a work-around. Best regards, Necuima.
  4. Hi Larry, On pages 284-5 you mention the browser unload event. I'd appreciate your advice re what I imagine is a common issue in that if someone just closes the browser without logging out I want to be able to update a database table to set a logged-out condition. Can this be done reliably either with native JavaScript or jQuery initiating an AJAX call to a PHP module to effect the database update? My program is PHP with lots of jQuery. Looking forward to your advice re this or similar functionality and thank you in anticipation. Cheers, Necuima
  5. Hi Larry, Thanks for this. I have been having computer troubles and am having to re-build ALL my software from a clean Win 10 installation. Fortunately I have great backups :-) I'll test again when I have re-installed XAMPP. Thank you for following this up. Cheers from Oz, Necuima
  6. P.S., the script is your script 'sessions.php' just renamed and on your original it is line 53. Up top I just added As per your 'advanced' book.
  7. Hi Larry, Finally got to a point where I could try your suggestion. Sadly, if I applied your suggestion correctly, it did not solve the issue. Please see the attached. The database entry looks OK. Cheers, Necuima
  8. Hi Priyam, What script in Larry's book are you trying to use (and page number in the book)? Also see: https://www.w3schools.com/php/func_mysqli_num_rows.asp Necuima
  9. Hi Larry, This time it is me that is sorry re the delay in responding. I have just started changing over from Win 7 to Win 10 which is inhibiting my ability to test your proposed solution. I have a LOT of stuff on the Win 7 PC so am taking it very carefully - bit by bit - as I make the change to the (separate) Win 10 PC. Also am making the change from Windows Live Mail to Outlook and that's not as straight-forward as one might imagine especially as I want to migrate all my email storage folders over to Outlook. I will test your suggestion as soon as I can but it might be a couple of weeks before I can - and please accept my apologies for my tardiness. Cheers from Oz.
  10. Hi Larry, I can see the test charges now - they don't show in the dashboard until you capture them. Thanks as always for your insights. Cheers, Necuima
  11. Mmmm, I have the charge captured now but to be truthful I don't properly understand this. I retrieved the id from the response body: $charge__id = $charge->id; $charge = \Stripe\Charge::retrieve($charge__id); $charge->capture(); and the id is clearly not the token. So I hope that I am doing it correctly! A further query, I cannot see 'response_reason_text' in the log so maybe it is only there if the charge gets rejected? Again, any advice will be most appreciated. Thanks, Necuima
  12. Thanks to the advice received, I am making progress. I can send a charge for payment and receive confirmation that it is marked as 'paid'. But I have a puzzlement re page 518 re 'capturing charges'. Firstly, it seems that the charge_id is the token - is my understanding on this point correct? I used that anyway in the 'retrieve' statement and it did not object. (I am adapting Larry's code here for my own purposes, in fact a single charge). The '$charge->paid returns true which I test in my code and I can also see it in the Stripe test log. It does this whether I invoke the 'retrieve' and 'capture' statements or not. But the dashboard does not show any $s even though I have now sent dozens of charges all of which have returned true for paid. Any advice will be most appreciated and thank you in anticipation. Necuima
  13. Yes, I now have SSL enabled on my localhost XAMPP environment - thank you for the advice.
  14. It's OK - I tried \Stripe\Charge:: etc and that did not give the error. But now I have another error which seems to be associated with an SSL certificate. As mentioned I am trying to test this on localhost which, in my case, does not have an SSL certificate. I understood from a previous query on Stripe that I could test this from localhost without my XAMPP/Apache having an SSL certificate. Have I mis-understood this? The beginning of the error is: "An error occurred in script 'C:\xampp\htdocs\DMChat\modules\process_payment.php' on line 213: Stripe\Error\ApiConnection Object ( [message:protected] => Unexpected error communicating with Stripe. If this problem persists, let us know at support@stripe.com. (Network error [errno 77]: error setting certificate verify ..............." This was from the catch block: catch (Exception $e) { // Try block failed somewhere else. trigger_error(print_r($e, 1)); } Again, your advice will be most appreciated, Necuima P.S., you can probably figure out that I am using your model/view/controller approach from the advanced book :-)
×
×
  • Create New...