Category "php"

How do you make button save form data on a csv file and redirect you to a new page at the same time?

I am trying to make a button that saves form data on a file and redirects you afterwards, but although the save function works just fine, the redirection doesn

Placeholder is not showing up

echo "<label class=\"control-label col-sm-5\" for=\"badgeid\" style=\"margin-left: -50px;\">Recipient:</label>"; echo "<div class=\"col-s

Add a custom fee for percentage and fixed cost to specific payment gateway in WooCommerce

In WooCommerce I need to apply a custom handling fee for a specific payment gateway. A custom handling fee for percentage cost and a custom handling for per fix

Youtube Google API Caught Google service Exception 0 message is refresh token must be passed in or set as part of setAccessTokenStack

I am currently facing this problem: once I authorized youtube to access my account and after saving the token in a file called "token.txt," everything runs smoo

Dynamic Text under Product Price on Product page in case a variation is selected

How can I create a text A under the product price on the product page in case a variation is not selected. When a variation is selected I would like to have ano

How do I hide '#StandWithUkraine' in PHPUnit 9.5.20?

I have recently upgraded to PHPUnit 9.5.20 and noticed that it is printing #StandWithUkraine for every test run. Eg. Testing started at 10:01 am ... Running in

CodeIgnititer 4: Unable to send email using PHP SMTP

I read all the other answers related to that question, but none of them help. When I try to run the following setup either on my localhost or my production serv

Rest API GET Query working fine in Browser but why is it not working in Client software?

I made my own REST API with php coding and mySQL database. There is no Authentication. Just a GET call should retrieve mySQL table rows. <?php header("Acces

how to load the php file in the form action only after php submit button was executed

I am not a PHP expert. I have a form that has Captcha validation image. the form has a button "submit", and the code for the submit is within the same page (let

How to report ModelNotFoundException with stacktrace to Sentry.io in Laravel 6?

I am using below laravel 6 code to report exceptions to Sentry.io: public function report(Exception $exception) { if ($this->shouldReport($exception) &am

mysqli::real_connect(): (HY000/1049): Unknown database error in codeigniter

I'm new to Codeigniter PHP framework. When I'm testing my application I get 'Unknown database db_name' error. I have browsed through several sites but didn't fo

Add custom text 'per item' based on product category in WooCommerce email notifications

How to add a custom text 'per item' based on product category on all WooCommerce emails? Therefore I tried to modify Add a custom text for a particular product

how can I Install php script on subdomain

I have a website abc .com,it already using php script. And I need to install another php script on subdomain like web.abc .com. I have allready created subdomai

How can I store data from JS into a MySQL database

First things first, I'm new to the forum, anything I write that isn't concise or just flatt out adjective let me know! I'm developing an app that can retrieve d

Htaccess doesn't let access to sub directories with parameters

I am trying to create a htaccess for seo urls, I created my htaccess all urls works fine exclude subfolder with parameters, they redirects to sitefolder. sitefo

Laravel custom validator returns page instead of json

I made a controller to store tasks, it looks like: public function store(StoreTaskRequest $request) { $validated = $request->validated();

How to transfer a variable from 1 function to another in the controller?

It is not possible to transfer data from one controller to another. There is such a controller for filling mp3 files via Dropzone.JS: public function upload(Req

Wordpress - User last login date shortcode not work

I have this shortcode, it should show the last login date to users. The problem I find is that all other users are viewing my last login date and not their date

PHP Form implode / explode

I am using the a db field merchant_sku_item in a form. the original value is separated by / in the db like this: 2*CC689/1*CC368-8/1*SW6228-AB I want to displa

Global php variable is always null

I have a bug in my application which I do not understand at all. I made a minimal example which reproduces the issue: <?php class MyClass { const ITEMS_PE