I am using php mailer at my website contact form. When i receive a message in greek language, i don’t receive the text as typed in the contact form. In class.phpmailer.php file line 59 the encoding is …
How to generate “screenshot” of html div with external images?
I have a HTML div with external images. (The following is an example, but in the actual case I am using Amazon S3, so downloading and storing the image on the same server is not an option) Currently I …
Laravel no logout option from menu after successfull login
Hope anyone else had the same issue and was able to solve this problem. I installed a fresh Laravel project and used php artisan make:auth to get the basic auth working. Strange thing is that after a successful login there is no logout link in the navbar. It should be available under the username (which has a…
How to start a php script from cli within wordpress
I wrote a PHP script, which was meant to be a WP-Cron-cronjob and which uses wordpress specific functions. Due to some restrictions in its runtime enviroment, I need to start this script from the command line with /usr/bin/php -q longThing.php instead of as a WP-Cron event. How can I ensure that all the wordp…
Laravel 5 is not working on shared hosting
I have tested my Laravel 5 project on localhost its working fine with this url – http://localhost/project-name/public/ Then I uploaded my project on shared hosting, I have made desirable changes for …
WooCommerce Retina Image Support – Not included in srcset
I’ve recently installed WP Retina 2x, and it generates the @2x images on my server. However, when using the PictureFill or WordPress Responsive methods, the srcset does not include any @2x images or 2x declarations: I should also mention that my media is stored on Amazon S3 using the S3 Offload Lite plu…
Fastest way to check key exists in redis – php
Is there any other faster way than EXISTS, to check if a key exists in redis or not? My problem is, I have over 1 million records in redis and I need to do a key_exists check. This should happen within 10ms. Any Ideas around this? Answer Using the EXISTS command is the fastest way, this should be extremely qu…
Laravel Blade compileString gives me a Blank Page
I tried to create a new blade directive in my AppServiceProvider: And then call this directive in my view: @test() But it’s not work and gives me a blank page. Answer i try several things but finally i fix this by copy and paste blade directive code from BladeCompiler.php to my custom directive instead …
Uncaught Error: Call to a member function fetchAll() on boolean
index.php: and get the error : Db.php If I running in the sql() method, execute() and fetch() the data inside it , it can truly get the data , but put the execute() and fetch() to the query() method, getting the error message, Any Idea? ; Answer There is an error in your code. In this line: The execute() meth…
WooCommerce Check stock of product ID before adding
I have some custom code in my WooCommerce site that adds a product to the users cart. I already have it check the cart contents to make sure there is another product in the cart first, but I also …