Stay up to date
We'll highlight new content in your collectives with a blue activity indicator on navigation items and posts.
Manage preferences
Questions
Browse questions with relevant PHP tags
1,467,499 questions
0
votes
0
answers
9
views
Easy way to autonomous periodic data update in Laravel, PHP
How can I autonomous calculate and update value for one column in my Laravel project? I have no much experience in web-dev, so I just dont how to do it effective.
For example, now I've column "...
0
votes
0
answers
7
views
Laravel MongoDb Aggregation For unique and null
I want to retrieve documents from mongoDb by using MongoClient for parent_id is only first of same and parent_id is null.Only one aggregation.
$search[] = [
'$group' => [
...
-2
votes
0
answers
7
views
PHPUnit 'Error : Class "path\to\class\classToTest" not found'
I'm trying to write some unit tests however no matter what I do I keep getting the error 'Error : Class "path\to\class\classToTest" not found'.
The test I'm trying to run has a simple ...
-1
votes
0
answers
13
views
Using Puphpeteer to scrape web page with no classes or ids [duplicate]
I'm helping a friend to migrate their blog from a "homemade" platform to Wordpress and the original developers have not been helpful in extracting the content so I'm trying to figure out how ...
-1
votes
0
answers
20
views
Get sum of values in multi array [duplicate]
I have an array with different keys, and I am interested in the sum of the values of only the ones that start (or contain) "MT".
$json = file_get_contents($path2);
//echo $json.'<br&...
-3
votes
0
answers
24
views
how can i correctly return array value to jquery [closed]
<?php
include ('config/dbcon.php');
if (isset($_GET['visa-id'])) {
$visa_id = $_GET['visa-id'];
$query = "SELECT document, preference FROM visa_document WHERE visa-id = '$visa-id'&...
-5
votes
0
answers
15
views
Wordpress redirecting me to the homepage only, can't edit anything [closed]
Here is the video showing the exact problem i'm having, Wherever I click in the wordpress website on any page any setting it always redirect me to the Homepage only, I tried few solutions like
-...
0
votes
0
answers
11
views
woocommerce_before_calculate_totals doesnot update mini cart [duplicate]
I want to add specifics products in the cart if certain conditions matches. E.g for upto 100 a specific product is added with the price 0 and from 101 to 200 another products are added. I was able to ...
1
vote
0
answers
37
views
How to modify a PHP class to accept PgSql\Result as an attribute
I need to find a way (if possible) to make a PHP class accept a PgSql\Result object as an attribute. PHP 8.1+ has migrated the pgsql result resource to the PgSQL\Result instance. In prior versions ...
-3
votes
0
answers
23
views
concatenating different parts of an array [closed]
I would like to iterate through the array, and when encountering an element with a non-null mau, it will concatenate the tennpl strings of the previous and current elements together and assign it to ...
0
votes
1
answer
27
views
Problems with LVE ID 5487
I made a php application that uses the spatie library top convert pdf files to jpg, using ghost script and imagickMagic.
The process is slow, but in dev enviroment, it works fine. I just ajusted the ...
0
votes
0
answers
33
views
Session variable into a prepared statement [closed]
When I submit a form, I would like the Session variable user_id to carry through to my prepared statements so it can be inserted into my table.
Code
<?php
if($_SERVER["REQUEST_METHOD"...
-1
votes
0
answers
15
views
Cannot connect to Postgres from my php/symfony application
I'm having issues connecting to any database from my php/symfony application
when I try to connect to pg_connect("host=localhost port=5432 dbname=dbname user=username"); the app just dies ...
0
votes
0
answers
20
views
Live reload server (Gulp + BrowserSync) for php files doesn't work inside docker container
I have a fully functioning live reload server for my php projects using Gulp and BrowserSync:
gulpfile.js
const { watch, series } = require('gulp');
const browserSync = require('browser-sync');
const ...
0
votes
0
answers
16
views
Google PlayIntegrity API validate token via PHP
I try to get device verdict with google play integrity token, but always have a million errors and I can't understand whats wrong. My Code:
<?php
use Google\Client;
use Google\Service\...
0
votes
0
answers
20
views
Json error: Cannot modify header information – headers already sent on Aws-bitnami
Inquiries regarding logs in the following format are probably the most common due to json errors related to WordPress.
[Thu Jul 25 13:00:50.367263 2024] [proxy_fcgi:error] [pid 26574:tid ...
0
votes
0
answers
30
views
PHP not connect to Microsoft Fabric database
I am attempting to connect to a database on Microsoft Fabric, but it will not connect. It does not display any error messages, nor is there anything in the logs. I am at a loss for what the issue ...
0
votes
0
answers
15
views
filtered special Database statements for google index
I have the url() statement in my database. all in www.site.com/random_alias format (splash pages).
Some links were created by the admin (userid=1) and archived to specialized (archived=1).
how can I ...
0
votes
0
answers
15
views
Imagick creating PDF even though setImageFormat is set to JPEG
I have an odd issue that I cannot get to the bottom of. I'm using Imagick to generate JPG thumbnails of PDFs that are uploaded to a custom admin tool. However, Imagick is creating PDF files even ...
0
votes
0
answers
16
views
Why is Google Sheets PHP API failing when I insert a line manually in Google Sheets?
I have a PHP script adding lines to a Google Spreadsheet. It all works perfectly fine.
$client = new Google_Client();
$client->setApplicationName("Google Sheets API");
$client->...
-1
votes
0
answers
17
views
php8.1 - Deprecated code involving date_create() [duplicate]
Here are the errors I am getting:
Warning
: Undefined variable $modified in
/home/cssdar/public_html/members/templates/cassiopeia_members2024/index.php
on line
38
Warning
: Undefined variable $...
1
vote
0
answers
13
views
Understanding uriTemplate and Variable IDs in Symfony API Platform
I'm currently working on a Symfony project using API Platform, and I'm running into some confusion regarding the uriTemplate system and how it handles variable IDs.
I have an entity called Article, ...
0
votes
2
answers
50
views
Get model relationship collection from another database in Laravel
I have set the connection to two databases properly. I also have created eloquent table models and I can query a single table relationship from another database easily e.g.
$user->customer
User ...
-1
votes
1
answer
33
views
Detecting OR operator sequences and wrapping their content in a parenthesis when building a query with PHP
I made the following PHP code to build a query based on user input, where they can choose the condition and the operator and the resulting query would be printed on their screen every time they added ...
0
votes
0
answers
22
views
Error when submitting to Database: No data supplied for parameters in prepared statement [closed]
I'm building a webform that a User would fill out and then submit, adding their details into a table called atyzi_wctc in the Database. The Database is making the connection, but it keeps responding ...
0
votes
0
answers
18
views
php file not found when path contains spaces using fastcgi unix socket
I am transferring a site that was built on windows xampp to a server running ubuntu 24.04, apache 2.4.62, and php 7.4.33. Everything is working fine except php files containing spaces anywhere in the ...
-2
votes
0
answers
24
views
MacBook remote database access works with Sequel Ace and MySQL Workbench but not php (not a duplicate) [duplicate]
My remote database access works with Sequel Ace and MySQL
Workbench but not php
My connection script contains the exact same data.
I've searched everywhere for a solution.
Any idea why?
Thanks.
Robert
...
-2
votes
0
answers
28
views
I'm using the PHP Server extension in Visual Studio Code and received a message
Hi I have created a website with .php format and I need help to run these PHP files on VS code, here is the massage that shows "From v3.0.0 onwards, PHP server will open the server URL in your ...
-2
votes
0
answers
24
views
Mapbox display pins from point A to point B [closed]
I have a mapbox with multiple pins.
How can i display only pins from specific A point to specific B point within a radius of 10 km?
Specific points will be typed by the user from two text inputs (A ...
-2
votes
1
answer
24
views
Limit the number of characters / words in WooCommerce product backend [closed]
When we create a product in WooCommerce, I want to :
limit the product title to 30 characters
limit the product short description to 50 words
I found many shortcodes that limits that in the frontend,...
0
votes
0
answers
8
views
GraphQL nested objects query returns internal server error
I am learning GraphQL server with PHP, MySQL and I have following problems with nested objects.
This is my ProductType.php:
<?php
namespace App\Types;
use GraphQL\Type\Definition\Type;
use ...
0
votes
0
answers
20
views
Remove backslash from escaped forward slash in a string
I have an array(imageURLS) of string in js. Used 'fetch' to send the array as JSON.stringify(imageURLS) to savedesign.php. The array elements are like ['shop/2.png' , 'shop/3.png']. But each elements ...
0
votes
0
answers
17
views
File Size & Resume Option is Not Showing While Downloading File with HTTP Header
I've written a code in php, which is used in downloading link like https://example.com/dl.php&file=test.zip. Here the file dl.php checks the HTTP refer, if it is allowed then it download the file ...
1
vote
0
answers
15
views
Using Laravel Reverb with Laravel and Nuxt and multiple apps/layers
I have a weird issue. I am using Laravel Herd Pro locally for development and I added a Laravel Reverb Server using the Services in Herd. I got these credentials:
REVERB_APP_ID=1001
REVERB_APP_KEY=...
1
vote
0
answers
18
views
prevent change quantities on cart page
I'm using combo offer woocommerce plugin to make a bundle product with specific item number of linked products.
I had unchecked this option:
"Buyer can change the quantity of combo products?"...
1
vote
0
answers
34
views
PHP - Issue when adding a return type declaration for a parent class [closed]
I have currently have the following classes:
class Textarea Extends Field {}
class Field {}
I'm trying to declare a return type for the following function
public function field(string $field): Field
...
0
votes
0
answers
25
views
How to view images and sentences like "With text wrapping -Square" of Word - laravel-dompdf
I'm using laravel-dompdf now for printing pdf.
PDF format:
Two images are displayed on the right half of the first page.
The sentence is displayed as much as possible in the left half of the first ...
0
votes
1
answer
32
views
Eloquent ORM performance with subqueries for relational models
Laravel eloquent uses subqueries for relationship model instead of joins as joins offer more optimal performance .How does eloquent orm ensures performance for relational models ?
-4
votes
0
answers
24
views
I am having a problem removing a google mark from my website [closed]
I am having a problem because my website is showing a google mark on the right hand side. I want to remove it. But I don't how to do this.
The website name is https://mozodeals.com/. I have deleted ...
1
vote
1
answer
12
views
Custom Low Stock availability string for WooCommerce product variations backorders allowed
I'm looking to edit the woocommerce low stock message. But only for product variations which are set to allow backorders.
The message should include the stock level, and only appear when the stock ...
0
votes
0
answers
19
views
Problem with ACF Date Range and Repeater Integration in WooCommerce
I am using ACF to create fields integrated with WooCommerce. I am struggling to manage the tour status for each period in the Week Days mode:
The tour has 2 modes: Week Days and Exact Dates.
A tour ...
0
votes
0
answers
26
views
Microsoft Graph API Authorization Error: 'Invalid size of Code_Challenge parameter.'
I am trying to generate an access token via a PKCE flow to call the Microsoft Graph API.
I am following this msdoc : Microsoft identity platform and OAuth 2.0 authorization code flow - Microsoft Entra ...
0
votes
0
answers
15
views
How to change "ownerRecord" in RelationManager in Filament 3?
It is a basic RelationManager example of PostResource:
public static function getRelations(): array
{
return [
MediaRelationManager::make()
];
}
$post->media() (morphMany).
...
-2
votes
0
answers
24
views
React Expo push notification, sending notification to required channelId from PHP
https://exp.host/--/api/v2/push/send
{
"to": "ExponentPushToken[***************]",
"title": "Test Notification",
"body": "This is a test message.&...
1
vote
0
answers
57
views
Accented chars in dates
I've a problem in formatting dates in it_IT locale.
I've a customer with a site running on PHP 8.0.3, and due to some certification issues (this customer has to mantain ISO27001 certification) I've ...
0
votes
1
answer
49
views
Upgrading PHP to 8.3.9 from 8.2.12 on Windows 11 - cURL is not working [closed]
Steps I am taking:
Fresh install of XAMPP, which uses PHP 8.2.12.
After install, I confirm that cURL shows enabled in my phpinfo and my local coding files work as expected.
I renamed the existing php ...
0
votes
1
answer
27
views
AlpineJS submit a form without refreshing the page
I am working with Hyva theme with AlpineJs on Magento and using a <form> with the needed inputs to add a product to the shopping cart.
This is part of the form code:
<form method="...
0
votes
0
answers
46
views
Problem while trying to run composer update
I'm currently working on the dockerized version of ProcessMaker 4.1.21 and I'm encountering the following error when I try to run the "composer update --ignore-platform-reqs" command :
PHP ...
1
vote
0
answers
18
views
Watermark for custom image size in WordPress
I use a watermark code for a WordPress theme. The code works fine, but it generates a watermark for every uploaded image. How can I modify my code to not watermark some image sizes?
I have an image ...
0
votes
1
answer
27
views
Can i login using only pin in Auth::attempt
i tried this to login but it failed to login in system
if (Auth::attempt(['mpin' => $otp])) {
$check_otp->update(['otp' => '']);
session()->put('is_login', true);
session()-&...
Members can contribute articles
Simply submit a proposal, get it approved, and publish it.
See how the process works
Simply submit a proposal, get it approved, and publish it.
See how the process works