Category "php"

RestFul API For Delete And Update Get 403 Forbidden Codeigniter 4

Remember this is codeigniter 4. I need help in here. I am learning to implement about the RestFul API in codeigniter 4. Below is my detail code. Routes : $route

is there a way assign IF statement or Switch Case to a variable

I am trying assign grades for input integers. But I found it difficult to complete the code. Is there any other way to do the below code such that it will give

in csv file data is not in proper format show some html code in cakephp

Data in csv file is not in proper format it show like as javascript code or html code in only one column Code in userscontroller for export data in csvfile from

onclick() event is not working in javascript and span tag

I have written the below code to display textarea in the form but it is not working in javaascript. the real requirement is when i click on reply in span tag a

Eloquent Where using CASE WHEN and withMin()

I have a query like this: Product::withMin('promotions as promotion_price', 'promotion_products.price') ->orderByRaw('CASE WHEN promotion_price IS NULL THE

How to use Oauth2 Provider instead of Oauth1 in Laravel Socialite?

I'm currently developing social listening API with twitter, the flow is logged in user (using basic API Token to send request to the API) are redirected to twit

Strange result in loop when use special chars

I have strange problem when special chars in loop when add br and use specal chars, if don´t use words with special chars no have problems but when use sp

By click of the button the same form is added under that form but how can i get the value of the number of times it getting printed &store it in table

by click of the button the same form is added under that form but how can i get the value of the number of times it getting printed &store it in table. How

How do I remove the links from product names in WooCommerce order emails?

When a customer receives their woocommerce order completed email, there are 2 columns. In the left column is the product name and in the right column is the dow

How can I use Php7.4 in my Apache in Ubuntu 22?

Recently I upgrade my Ubuntu from 20 to 22. I was using Php7.4 in Ubuntu 20 with the Apache server. After upgrading to Ubuntu 22, the Php Upgrades to 8.1 automa

PHP extracting from hard array [duplicate]

How can I extract all elements from this array through PHP? I tried to do with array_slice but it didn't help My main problem is that I need t

How can I set variable php and mysql code

I want to set a variable "name", I tried: if(isset($_POST['name'])), But not result. I was also looking for other options but could not get results. I have a PH

If / Else in HTML within a return of PHP function

I am trying to use an if/else statement within an HTML structure of a return in a PHP function: function price_vat() { global $product; $condition = $pr

Dependent dropdown using WHERE clause

I am looking for some help. I need to create a dependent dropdown based on the previous input. Everything works in my code, and it sends and receives data from

Getting hidden values on returned ajax results [closed]

I have a shipping estimator I am trying to reset via ajax on any cart change. I have the call and ajax working well on all of the page except

Change "view-order/order-id" url/endpoint in WooCommerce My account - orders to "orders/order-id"

Currently the URL, under the WooCommerce 'My orders' tab, for the button when you view an order in detail is equal to /my-account/view-order/ORDER-ID/ I would l

Remove Klarna Payments with cash on delivery method

I have a problem with a code. So I have five different payment methods in my site. When a customer select "Cash on delivery" as shipment method all the payment

Student Project - Fatal Error: Uncaught Error: Call to a member function prepare() on null in php

I'm working on a student project. I'm building an e-commerce website to sell soaps, and the error message I'm getting is the following. Fatal error: Uncaught E

How to store the image ID and image of a set of shuffling images in array

I'm a newbie and still learning how to code. So, any help is much appreciated. This is what I have in an image of what's done so far. How do I save the selected

sorry - old question again: imagecropauto() not working

I have some simple code: $original_image = imagecreatefromjpeg($image_path); $cropped_image =imagecropauto($original_image , IMG_CROP_THRESHOLD, .5, 16777215);