i would like to create a PHP script that delete files from multiple folders/paths. I managed something but I would like to adapt this code for more specific folders. This is the code: <?php …
Laravel: How to configure eloqent to throw exception on database timeout?
If database is not available there is some seconds of loading. Then the log shows this error, should’nt that trigger the exception handler? (other errors end up their as expected) Then I see “504 Gateway Time-out The server didn’t respond in time.” Error. How do I configure eloquent so…
php ajax insert shows blank response but no error
I am simply inserting a demo data by ajax form to database. The ajax shows no error but shows blank response when i use console.log(response);. Php code- <form role="form" id="…
Add WooCommerce booking date and time to admin orders preview
Hey I am using Woocommerce with an additional extension (Woocommerce Bookings and I wondered if there is custom code that would display the booking date and time (not the order date and time) in the woocommerce order preview I found several codes mostly by LoicTheAztec that let you insert product and customer…
Add variable product downloadable files based on variation attributes in WooCommerce
I am trying to check if a product variation is currently in the cart, and add dynamic content to the email & thank you pages based on which variable products are present. The dynamic content would be generated via custom file input fields (ACF) added to the product on the admin side. I’ve managed to…
PHP get JSON Web Token with Guzzle
I use Laravel 5.3 with GuzzleHttp 7 and want to make an API-Call to another Server in order to authorize and get a JSON Web Token in return. The curl command runs perfectly fine and returns a JSON Web Token with status code 200: In PHP: Answer I have made small changes to your code to make it more better,
How to display a $_SESSION variable in custom woocommerce checkout field?
I am able to verify by viewing the “Application” tab in the dev tools that my session variable has carried over to the checkout page; and I have the WC hook setup that allows me to change the “default”/value of the field I want to insert data into. However, I am unable to get them to r…
PHP array_multisort with array_column not working
I am trying to sort multidimensional arrays by a single column. I have an array that is created in a method and returned as $GDdata. This is a snippet of my unsorted array displayed in a table. Here I am selecting the column I want the final array to be sorted by: $GDcol = array_column($GDdata,0); I can succe…
PHP storing array in database
Soo i have saved a array inn my database using var_export($myarray, true); But when im trying to get the array from the database later i cant figure out how to do it. here is what ive tried now $henl =…
HTML form rendering with weird hidden input fields
I have a new ecommerce site, which uses lead forms to collect customer info. On our live production site, there are hidden input fields with encrypted looking name and value attributes. Here is an example: These fields are not present in the template code, so I don’t know why or how they are getting add…