I am reading https://www.amazon.com/PHP-MySQL-Web-Development-4th/dp/0672329166 . And there is OOP chapter where I have implemented the page class (code below), and then in another script try to make …
Accessing the contents of .env via the env Facade
In my Laravel 7.x application, I added some basic configuration to my .env file, eg: MY_SECRET_KEY=foo In my controller, I am attempting to read in the value via the following: Log::debug(“ENV[…
SQL not Inserting using PHP
I have the following code sending data from a form to an SQL database: My database table is structured as with studentID being a primary key auto incrementing and all fields apart from dob as text (dob is set as datetime) The form which is sending the data looks like this: I’m not getting a PDO error bu…
Read and join multiple remote files PHP
I’m using this code to read multiple remote files: $filters = [ “https://example.com/file.txt”, “https://example.com/file1.txt”, “https://example.com/file3.txt” ] …
How to display description on Woocommerce featured products?
I trying to add the the product description to all my related products. This is the code I have from content-single-product.php template file: <?php /** * Hook: …
Get a list of siblings term ids from current product category in WooCommerce
I want to retrieve a list of term Ids based on the current category ID. At the moment I’m using the following code: $product_cat_items = get_queried_object(); $product_cat_id = $product_cat_items-…
Cookies error when connect via ssh port forwarding
I have a PHP script running on the remote server inside private network. And I need to give only access to it via ssh port forwarding (ssh -L ….) remote port 80 to local 8080. The script sets …
Alphabetical filtering of custom post type in WordPress results
I’m working on a custom post type archive and I want to add an A-Z filtering menu. I managed to pretty much get it working following this thread (Create alphabetical Pagination in wordpress) but I …
Docker / Symfony / MongoDB – Cannot install mongodb with PHP 5.6 FPM
I’m not able to install mongodb extension using php:5.6-fpm image. What’s wrong with my Dockerfile configuration ? I have the following error when executing docker-compose build Answer Solution:
WordPress – Add a new class to an element on same template-page.php depending the active page? [closed]
I create a custom template “page-products.php” for all my products page. Inside of this template, i have a horizontal menu with 8 items. example capture of the menu When i’m on the page of …