Jump to content
Larry Ullman's Book Forums

Necuima

Members
  • Content Count

    337
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by Necuima

  1. OK, I'll use the timestamp approach. Thanks for the advice. Cheers, Necuima
  2. 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.
  3. 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
  4. 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
  5. 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.
  6. 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
  7. 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
  8. 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.
  9. 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
  10. 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
  11. 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
  12. Yes, I now have SSL enabled on my localhost XAMPP environment - thank you for the advice.
  13. 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 :-)
  14. Hi Larry, I am trying to use Stripe from my localhost and have established a test account with Stripe Australia. I am getting error "Class 'Stripe\Stripe_Charge' not found in .....on line 182 - I am on page 508 in the book. I have Stack-Overflowed and tried their solutions but none work. I am not able to use composer as I'm using PHP 5.5.3 on Windows 7 so I did the manual download and as far as I can tell all that is OK. Again, any advice will be most appreciated. Cheers, Necuima
  15. It's OK, I've found the issue. As my design does not follow yours exactly I need to add the additional data to the $_POST/form via hidden elements. Sorry to have bothered you. Necuima
  16. Hi Larry, I am trying to use STRIPE for the first time. I have set up a test account and that seems to be OK. I am adapting your form in billing.html but in a PHP script. The validation of my data via the ajax call to Stripe is OK as I am able to submit the form but when I check what data are received by my adaptation of your billing.php I can see the posted token but no form data. My form is attached. Can you see what I am doing wrong please? Thanks, Necuima
  17. I checked with the PHP manual and from PHP 7.2 the return from session_write_close() is a Boolean rather than a void. Might this require an update to the session code in the book? I tried just adding $rc = session_write_close() but I'm still getting the error. Thanks, Necuima
  18. Hi Larry, I have been using your database session handler for quite some time now in my Windows 7 environment but have run into a problem when I try to use it in a new PC set up with Windows 10 and Apache/PHP 7.3.7 (64 bit). I keep getting an error: "An error occurred in script 'C:\xampp\htdocs\....php' on line 53: session_write_close(): Session callback expects true/false return value" and I am getting this error everywhere that I have used 'session_write_close()' as per page 95 of the book (that's in dozens of places). Is it perhaps not needed in Win 10 with a fairly current Apache/PHP install? Or do I need to code it differently? Any advice will be most appreciated and thanks in anticipation.
  19. I had the same problem and I found that I had the BASE_URL set incorrectly in module config.inc.php Once I fixed that the activation script ran OK.
  20. In case you need to have both C++/Magick++ and Imagick on your PC (localhost), after much trial and error I found, with thanks to those who posted the guidances and data following, how to install it correctly. My environment is Windows 10 with the latest 64bit XAMPP from: https://www.apachefriends.org/download.html I installed XAMPP/PHP version 7.3.7. My development environment in this case is Visual Studio 2019 and Dreamweaver CS6. The primary guidance is from: https://herbmiller.me/installing-imagick-php-7/ with many thanks to this gentleman. But if you follow this exactly you will not have C++/Magick++ available. Regarding compatible Imagick dlls and ImageMagick versions, see also: https://mlocati.github.io/articles/php-windows-imagick.html with thanks to Michele. But again, the ImageMagick zips will not give you the C++/Magick++ headers or sub-directories. For that you need to do the ImageMagick install from an exe and you can get this from: https://ftp.icm.edu.pl/packages/ImageMagick/binaries/ with many thanks to that institution. You need to select the C and C++ headers option as well as the legacy option during the installation. You need to be extremely careful to install the correct/compatible versions in all cases as advised in Herb Miller's post. By following this guidance exactly I managed to get one installation of ImageMagick with the PHP/Imagick and Magick++ functionality available. Cheers
  21. The MFC form does not use .NET whereas the VS2015/19 standard form constructs use .NET and that was what was preventing the cpprestsdk (Casablanca) communication with the back-end server on localhost. At least that is how I understand it. Again, just FYI. Cheers
  22. Hi Larry, back in April I was looking for a way for a C++ front-end to 'communicate' with a PHP back-end with all functionality being on one PC? I.e., the implementation of PHP in my case would be via XAMPP. On April 21st I reported that I had tried to use cpprestsdk (Casablanca) with a Windows Form via Visual Studio but that did not work. But today I managed to get the functionality to work perfectly by developing the form with Microsoft Foundation Classes (MFC) which I had never used before :-) That took over 2 months - just as well that I am retired and have the time (and perseverance :-) The IDE was VS2015/19 Community Editions. Just FYI, Cheers
  23. Hi Larry, Thanks as always for your interest and advice. As an aside I had not used FLEX/WindowedApplication for a few years so I was a bit rusty but all OK again now. Referred to your FLEX and AIR books both of which I have. I now have the application working just fine on both Win7/PHP 5.6 and on a separate computer with Win 10 and PHP 7.1 Cheers from Oz, Necuima
×
×
  • Create New...