Questions tagged [php]
PHP is a widely used, open source, general-purpose, multi-paradigm, dynamically typed and interpreted scripting language originally designed for server-side web development. Use this tag for questions about programming in the PHP language.
1,443,190
questions
0
votes
0
answers
4
views
PHP Imagick Convert animated webp to Gif
For compatibility reasons, I'm working on some code that converts animated webp images to animated GIF format using PHP Imagick (Imagemagick). The issue is that for the output GIF each frame seems to ...
0
votes
0
answers
6
views
get on_sale_from and on_sale_to each variable is a product
i want to display on_sale_from and on_sale_to in single product, i don't want to use hook but put the code in variation.php file in path : /themes/theme-child/woocommerce/single-product/add-to-cart/...
-1
votes
0
answers
3
views
261 errors found Column count doesn't match value count at row 1 Dolibarr
Hi guys still new here i m trying to import my customer data to dolibarr but everytime i tried to do so it always comes out as this > Column count doesn't match value count at row 1
This is the ...
0
votes
0
answers
11
views
WP offload s3 media lite wordpress plugin not able to upload images and files to s3
I am using WordPress 6.0.1 with PHP 8.1.8 I set the WordPress to use the wp offload s3 media WordPress plugin but it's not working as expected.
When I upload the images it's not going to the s3, ...
0
votes
1
answer
10
views
WooCommerce: Make Name and address fields read only
Currently I have billing address set to read only using the following code but I need to add customer first & last name to the read only too. I'm placing this in my theme functions.php file
...
0
votes
0
answers
7
views
When I compile PECL imagick using phpize, I get the error "undefined macro: _m4_divert_diversion
When I download the source of PECL imagick and compile it using phpize
I get an error "undefined macro: _m4_divert_diversion".
CentOS6.7
PHP7.3
autoconf 2.71 → 2.69
m4 1.4.13 → 1.4.18
...
0
votes
0
answers
24
views
how i can add "?backurl = some' to main url?
hi this url is "https://bannerboo.com/campaign/"
but when page load url is : "https://bannerboo.com/auth/?backurl=/campaign/"
I tried php get refer but not work like this.
what ...
0
votes
0
answers
7
views
drupal existing site redirecting to already installed page
drupal existing site redirecting to already installed page on clicking upon view existing site link. Downloaded a site from a live server, imported database. changed db configuration in settings php ...
2
votes
5
answers
30
views
How to replace all occurrences of a character except the first one in PHP using a regular expression?
Given an address stored as a single string with newlines delimiting its components like:
1 Street\nCity\nST\n12345
The goal would be to replace all newline characters except the first one with spaces ...
0
votes
1
answer
13
views
Using symfony UnicodeString on laravel
I want to use unicodeString from symfoni in laravel controller
protected function validateWaWebhook($known_token, Request $request)
{
if (($signature = $request->headers->get('X-Hub-...
0
votes
1
answer
16
views
Update post_author on button click via ajax request
I'm somewhat new to PHP and WordPress.
I'm attempting to update a posts "post_author" when a logged-in user, who is the author of this post, clicks on a button on the post page itself.
This ...
-3
votes
0
answers
20
views
Random matches with conditions [closed]
I would like to ask some help regarding the derby match matching my friend asked me about.
I used a simple CRUD to get and save the data. What's missing is the centerpiece which is the match maker.
I ...
0
votes
1
answer
16
views
php won't get the value after div relative position?
i am creating php form that change some elements after being selected. the idea is the field shown after the user select the option he/she wants. form position is relative that somehow affected the ...
-1
votes
0
answers
14
views
Error passing variable to function - Too few arguments
I've updated my version of PHP from 5.2 to 7.4 and now I'm receiving an error on a function that was working prior.
Here's the error:
Fatal error: Uncaught ArgumentCountError: Too few arguments to ...
-3
votes
0
answers
21
views
How to manipulate multi-dimension array in PHP?
I have a multidimensional array and I want to change it to my final array. Below is the array I have.
$test = array(
array(
"supplier" => "TEST DEPO",...
-2
votes
0
answers
9
views
At php Json response how to capture response selected to variable
I get the following response
'''
$tuya = new \tuyapiphp\TuyaApi( $config );
$token = $tuya->token->get_new( );
//$uname=json_encode($token, JSON_PRETTY_PRINT);
$obj = json_decode(json_encode($...
0
votes
0
answers
10
views
Clear Appended Fields after ajax success
After form is submitted how do I make all the cloned children elements get removed so only the parent element is left.
Currently after for submission the form resets but all the children cloned ...
0
votes
0
answers
17
views
Failed to listen (reason: ?)
i tried to change in vendor/laravel/sail/runtimes/8.0/php.ini and change variables_order to "GPCS" but its not working
Starting Laravel development server: http://127.0.0.1:8000
[...
0
votes
0
answers
10
views
How to add toggle password for multiple password field input (PHP). Currently my code only work for the last record in the table
Currently, my code able to toggle the password for the last record generated in table. I want to add toggle password for every password type field input generated in the table similar to Google ...
0
votes
0
answers
16
views
Validating whatsapp webhooks Payloads in laravel
I'm trying to validate the contents of a webhook payload from the whatsapp webhooks using the steps in the .Facebook developer docs,
I dont understand what this mean
Please note that we generate the ...
-2
votes
0
answers
33
views
Laravel - Elseif in JSON [closed]
its my first post in here,
This is < script > JSON in Laravel blade.php
I have this working
events: [
@foreach($events as $event)
{
id: {{ $event->...
0
votes
0
answers
20
views
Laravel Losing Sessions
In the in the routes/web.php of my Laravel 9 instance, I have the following code:
Route::get('/', function (\Illuminate\Http\Request $request) {
$rn = $request->session()->get('...
0
votes
0
answers
14
views
Handling time logs in php for Chartjs
I'm logging my Smart home devices either on or off into MySQL with Unix Time Stamp (So every time status changes, it adds a record in DB with new status and time). I would like to be able to view ...
-3
votes
1
answer
30
views
Looking for a particular WISIWYG editor [closed]
Photo of what I am looking for
I am currently creating an application using Laravel PHP, and I am trying to choose a WYSIWYG editor that is easy to use for the end users.
I have seen an example editor ...
0
votes
1
answer
13
views
How to stop redirection of the add to cart button on Category Page in Wordpress?
The link of the add to cart button is redirecting to the product page. We want it when the user click the link it will stay on the page and will just it to the cart. No redirection at all. Already ...
0
votes
1
answer
29
views
PHP Convert multidimensional array to a string (LITERALLY)
I have a PHP multidimensional array that looks like this:
[[1,45],[2,23],[3,37],[4,51],[5,18],[6,32],[7,29],[8,45],[9,37],[10,50]]
(Those numbers are stored as strings, not int)
What I want is to ...
0
votes
0
answers
25
views
Can I boot product from database to the page and make search box with it
Hi I'm doing my first serious project, and it's very stressfull. I'm searching on the Internet, how can I boot my product from server's database in my page and create list items with 5k products. I ...
1
vote
2
answers
28
views
Cannot retrieve channel.xml for channel "pecl.php.net" (Connection to `ssl://pecl.php.net:443' failed: Operation timed out)
From today 2022-08-11, the pecl channel-update pecl.php.net command is not working.
It start working and after a few seconds returns an error Cannot retrieve channel.xml for channel "pecl.php.net&...
-1
votes
0
answers
28
views
Unknown problem with sending http requests [closed]
I have a very serious problem with which I have been working day and night for more than a week and still have not found a solution. It seems that my nerves will soon give up. Let's get down to ...
-1
votes
0
answers
9
views
Etsy: After requesting an authorisation code, I cannot log in to grant access, to gain an access token
I have tried to tell the entire story in one screenshot, so feel free to look at it first before reading on. You may notice the problem before I even tell you what it is.
(This is live production code,...
0
votes
1
answer
17
views
Error passing input from html form to PHP for MySQL query [duplicate]
I am trying to use an html form to input a query search term to run a MySQL query. The input text appears to come over OK but the query results are empty when should have content.
I believe I've ...
0
votes
0
answers
22
views
How to limit the functions and features of a laravel blade file?
Good night guys phpzeeeeira!
Tell me something, to those who have used Laravel and dealt with Blade a lot...
Have you ever needed to make a Blade file available/open to the end user to let them edit ...
0
votes
0
answers
11
views
Gmail SMTP using PHPMailer, I am able to send messages but on Gmail account, not showing right sender information
As the title says, I am using PHPMailer to send messages on the contact form. I read quite a lot of questions here related to Gmail SMTP and can send messages. However, when I receive the messages ...
-3
votes
1
answer
18
views
Update HTML content after a webpage has been loaded without reload
I'm using php and jquery and trying to get a notification to appear after a user submits a form. I'm using ajax for the form submission so that the page does not reload. I want the notification to ...
0
votes
1
answer
20
views
PHP Touch() using time() parameter for the past -any limitation?
When changing a file's datetimestamp from the current system time to the distant past is there a limit with the time() parameter? With touch(), all the documentation I can see uses the time() ...
0
votes
0
answers
11
views
"Connection Refused" via PHP cURL from GoDaddy Hosting to internally hosted Radarr server's API (jQuery works though?!)
I'm at a complete loss as to why this is failing, so get ready for the novel describing exactly what I'm trying to accomplish and what I've tested so far.
Goal:
I'm building a webpage on my GoDaddy ...
0
votes
0
answers
9
views
Fetch single data from RESTApi
i built my rest api and working fine. I use my api for my web application .I can fetch all data from my api with json_decode and foreach operations but i have issue when i try to fetch only 1 row with ...
-1
votes
2
answers
19
views
Change Bootstrap Version In Big Laravel Project
Hey Guys I have A big Laravel Project And The project Bootstrap version Is 3
I Want To Change It . How I can do it?
0
votes
0
answers
11
views
Inserting multiple row at once in Symfony 5
I was trying to insert 1000+ data which for a transaction related reason in code but it takes a lot of time. So I checked out to find a solution to insert multiple data at once but couldn't find any ...
0
votes
1
answer
28
views
automation of the phpmyadmin database
I would like the date to change as many days as is given in the "interval" when I change vacation from 0 to 1
Here I paste my sweat;)
update employee_table
set date_nastne = date_nastne + &...
0
votes
1
answer
20
views
I want to iterate through JSON file to insert into table in PHP. I do not know how to iterate into every subarray. Help greatly appreicaited
I have been trying to iterate over JSON arrays to extract the data and upload it into a SQL server.
By searching online through other articles, I can recursively print out the data but am not quite ...
0
votes
0
answers
11
views
Ajax Request to backend always result in CORS error if jsone_decode is called
I have a linux server with the latest plesk installed. In the additional nginx section I added the cors entry like (because the call is from an other domain):
add_header Access-Control-Allow-Origin '*'...
1
vote
1
answer
16
views
Cannot connect to MySQL database container on Docker with Python script
When I try to connect to MySql Database my script get stuck. It simply does nothing. I use docker-compose.yml file (shown below) to run MySql database.
version: '3.1'
services:
db:
image: ...
0
votes
0
answers
8
views
How to read and add AWStats data into same domain website HTML (footer)?
I have a Drupal installation running over Nginx with Hestia Panel and a running Awstats website statistics system that can be accessed via URL. I wonder how could I get the unique visitors figure (...
0
votes
0
answers
16
views
Laravel DB WhereJsonContains pass a array to it
I'm pass a array to WhereJsonContains, but is return a empty array, my array is [2554,2674,2890] and a column from DB is products_responsibles its a json column its values is basically
[{
"name&...
0
votes
0
answers
16
views
Json encode from XML file creates empty array if element in XML is empty
I have a XML file, where some elements will be empty. The issue is, that this code, creates an empty array, if the element is empty. Som for the XML example below, the result from JSON_DECODE would be:...
0
votes
1
answer
24
views
Remove public directory from laravel project
i'm making a laravel project and i have a big problem, i can't remove the /public/ name from my URL. I saw a solution that move some files of the public dir to the root dir of laravel but i also read ...
0
votes
2
answers
45
views
if statement doesn't work after upgrading to PHP 8.1
I unfortunately need to upgrade to PHP 8.1 (from 7.4) and that brings some changes (and unfortunately error messages). I'm not a programmer, but always got along with customizations so far, as I could ...
-1
votes
0
answers
12
views
Connect Metatrader5 to php
i have 10 accounts in metatrader5 and it's a problem for me to login to each account and see statistic ( equity, balance, open trades ...)
there is any way to connect those account to a php ...
0
votes
1
answer
18
views
How to view SUM in price format?
I am using a PDO SUM statement to total the prices of items in a checkout page, I can get the correct result but if there is an item under 1.00 for example 0.70, it displays 0.7 instead of 0.70
So is ...