I need to extract console platform from the description of products in CSV file. I used regex to match all the console brands that are included in the list. This is for WP All-Import plugin PHP …
Getting a 403 error when using Google Indexing API
I am trying to send a POST request via the Google Indexing API, but keeps getting HTTP erro 403 (Forbidden). My code is below: My full response is as follows: I understand what “Forbidden” means, but I can’t understand WHY I am getting the error. I have followed the instructions for setting …
php `$_SERVER[‘PHP_SELF’]` is empty
I have a problem with my nginx and php configuration. For some reason, $_SERVER[‘PHP_SELF’] is empty. I am running: Ubuntu 18.04 nginx (nginx version: nginx/1.14.0 (Ubuntu)) php (PHP 7.2.10-…
Sweet Alert Delete Confirmation with a href
Im using PHP, and Sweet alert for a delete confirmation. Problem is that it is deleting before showing the sweet alert. This is my HTML(which is using PHP in it). This is my sweet alert } The problem is, its not showing the sweet alert, its just going straight to the URL. Do I need to do a form and
How to check user input in laravel
I have a column input named Address, and how to check, if user input like null, ‘null’ and ” , the return response will be error. I have make it, but it not working. This is my code: Answer You may use the empty function, which would return FALSE if var exists and has a non-empty, non-zero v…
Laravel keep chmod storage folder
When i access view in my laravel application, why is it always showed this error every 1 minute: file_put_contents(/home/vagrant/Code/myproject/storage/framework/cache/data/db/59/…
How can i get the correct “from” emailaddress, using PHPMailer and Google Apps?
I use a simple PHPMailer form to allow the users of my website to contact me through a contact form. I use my google apps account to send the mail. In the script i set the emailaccount the user provides me as the “from address”. Until a few weeks ago, this went well. From Google Apps i could click…
How to get an OAuth 2.0 token in PHP?
I need to connect to a REST API of a customer. The first step is to get an OAuth 2.0 access token. I got the following information from the customer: Login (I assume it’s the client_id) Password (I assume it’s the client_secret) The flow is password The regular API URL The Token API URL I found co…
Woocommerce cart items discount gets reset in checkout
I’ve been trying to implement a discount in my store with the following code: add_action(‘woocommerce_before_calculate_totals’, ‘set_discount’, 10 ); function set_discount( $cart ) { if ( …
share env variables between 2 containers from docker-compose
In my docker-compose, I have 2 containers, php-container, and nginx container. For nginx container I defined env variable, is there a way to access that variable in php container in code? I want to access in php code the PLAYER_NAME variable Answer Nope, you cannot do that, containers are isolated by design. …