1,461,576 questions
Score of -1
0 answers
31 views
Stream behavior in PHP
When getting a stream from an API using cURL with CURLOPT_WRITEFUNCTION I can keep a stream alive. A callback function can do things with the data as it comes in.
But I can't do this with fopen() ...
Score of 0
0 answers
75 views
CSRF token works on all forms except comments form - Session token missing in POST
I have a PHP website where CSRF protection works perfectly on all forms (contact, support, subscribe, add_post, edit_article) except for the comments form.
The problem:
The CSRF token is generated ...
Score of -1
1 answer
87 views
Replace element in array
I have a string
$sProducts = '2:1:-1:-1, 1:1:-1:-1, ..., n';
and an array
$aCount =>
(
[0] => 2
[1] => 3 .
.
...
Score of -1
0 answers
71 views
How can I detect the final destination URL after multiple HTTP redirects in Laravel?
I'm building a backlink monitoring SaaS in Laravel 12 where I need to verify the final destination of thousands of URLs. Many URLs return one or more redirects (301 or 302) before reaching the final ...
Score of -2
1 answer
130 views
Get number of rows (not the output) back from Ajax call invoking query in PHP class [closed]
I'm attempting to get the number of rows returned by a query in a PHP class member function back client-side. The output of the Ajax call is fine, no problems, but within the member function I update ...
Score of 0
3 answers
106 views
Need help in 419 token Mismatch in Laravel Sanctum SPA [closed]
The issue what i am facing is like i have configured Laravel Sanctum SPA just hours ago. It was literally working and now when i again used it it did not work i configured everthing which i will show ...
Score of 2
1 answer
73 views
How to add fields to user accounts in Grav 2.0
I am using Grav 2.0.12 and Admin 2.0.15. I want to add some fields (say mobile_phone and company) to the user accounts. I want to be able to edit these in the Admin area. I tried two ways, one by ...
Score of -1
1 answer
125 views
How to generate a config.php during docker compose?
I've got a somewhat legacy PHP application I'm looking to containerize for ease of deployment. It's going well, except that its configuration (primarily, where to find the database it's supposed to ...
Score of -1
1 answer
164 views
Header and Footer/user/admin nav bar [closed]
I want to make a navbar in the header and footer, and if the role is admin the user sees something different than a normal user, or is there a better way?
I'm planning to create a reusable header and ...
Score of 3
2 answers
124 views
How use PHP array_search for tags even it is an array tag
I tried to use the array_search function in combination with array_column.
$keyNum = array_search($tag, array_column(static::$tags,'id3'));// keyNum => number of key
if($keyNum !== false){// If tag[...
Score of -3
0 answers
89 views
Best practice for isolated, highly-available dev/staging/production environments across 2 Angular + 1 Laravel repos [closed]
I have 3 separate repositories that make up one product:
frontend-admin (Angular)
frontend-client (Angular)
backend-api (Laravel)
I need to deploy all three across dev, staging, and production, ...
Score of 4
1 answer
133 views
Parse and use Lichess stream data with cURL and PHP [duplicate]
I want to stream data from Lichess to the command line. I want to parse it and use it as needed without breaking the stream. I want to do it in native PHP.
$ch = curl_init("https://lichess....
Score of 1
2 answers
141 views
curl_close() deprecation in procedural PHP
All of my old scripts are written procedural and in writing a new one I've learned that curl_close() is deprecated and that a curl object is closed automatically. But do I have to rewrite all that ...
Score of -3
0 answers
84 views
Extract icon from APK file using PHP [closed]
I have got following code in php-apk-parser
but How to use it I do not know.
I download files from above Package and Extract to my cpanel.
Then I try to run follow codes in a.php but won't work.
<?...
Score of 3
2 answers
167 views
How to parse a predictably formatted string and extract multiple values
I'm trying to extract each piece of data out of this line:
INF Chat (from 'Steam_76561198379194238', entity id '1298', to 'Global'): 'DavSlo': !test
the "Steam_76561198379194238" "1298&...
