Questions tagged [php]

0 votes
1 replies
Why would authorization logic on OpenCart Admin Panel design like this (weired)?
We have lots of authentication and authorization methods to use (OAuth, 2FA, etc.) to ensure the security of our account on e-commerce platform....
1 votes
0 replies
Execute PHP file from HTML; Visitor Counter
Here is a copy of the PHP code I am running. <?php $conn = new mysqli_connect("localhost", "root", "", "adn") or ("die"); $visitor...
asked 4 months ago
0 votes
1 replies
Uploading to AWS s3 bucket in Laravel 5.8 gives me “Error retrieving credentials from the instance profile metadata server”
I have a Laravel 5.8 application that I am trying to configure my uploads to go to an Amazon s3 bucket, but everytime I try and save a Post with...
2 votes
1 replies
How can I select all post with a specific hashtag that a user is following in SQL & PHP?
In the Database I have a table with all hashtags (Table hashtag) and the user_id that is following the hashtag. In another table I saved the post...
asked 4 months ago
2 votes
3 replies
How to add a “…” after a particular word/character limit in PHP?
I am working on a php code as shown below: <div class="case-breaking__content"> <p><?php echo the_title(); ?></p...
asked 4 months ago
0 votes
0 replies
Where did the outputstream go when no method are set?
So basicly I have some Java code making an HTTPURLConnection on an ip an send json in the output stream and I suppose to catch it on my php serve...
asked 4 months ago
-1 votes
1 replies
Fetch data from mysql using jquery on clicking button
I fetched a number of data rows in the data table from mysql database. The last column of the table will show a button and i have added id of the...
asked 4 months ago
1 votes
0 replies
Implement Mutiple Clients Checklists
I have a list of clients and several checklists for each one of them I have a table set to pm1, pm2, pm3, ..., pm118 for all points in all checkl...
asked 4 months ago
1 votes
2 replies
Upload data to Apache server keep failing if uploading lasts more than 20 sec
I have a website where users can upload images to my hosting Apache/PHP server. If files uploading lasts less than 20 sec everything is fine. But...
asked 4 months ago
4 votes
1 replies
PrestaShop - Submitting Value to Other Controller Based on Existing Submit Button
I am using PrestaShop 1.7 and would like to achieve the following : I am adding a refund reason upon product return which by default PrestaShop...
asked 4 months ago
0 votes
1 replies
How do I concatenate two images in PHP to create a sprite?
My user can upload two images, and I have to create a sprite with both images side by side. I'm struggling a little to find how I can merge them...
asked 4 months ago
2 votes
1 replies
How can I use apply_filters or add_filter only on certain post types?
I'm trying to edit the markup of images, but only for one custom post type. How can I apply the filter to only that post type? I've tried queryi...
asked 4 months ago
4 votes
1 replies
Need to send an array in PHP
I'm trying to send multiples values to a PHP form. This is the form that I use to send values: <form id="form1" name="form1" method="POST" ac...
asked 4 months ago
1 votes
0 replies
The variables I include from another file are “undifined” [duplicate]
This question already has an answer here: Difference between require, include, require_once and include_once?...
php
asked 4 months ago
1 votes
1 replies
Laravel, add gate to see if user has access
I have got a table with my permissions, I want to be able to setup a route like below so that I check the logged in users permissions and see if...
asked 4 months ago
0 votes
2 replies
How to count distinct duplicate characters in a string
I have a string "Bbcdefcgh!!" and I want to count the distinct duplicate characters. The solution should consider upper and lower case characters...
php
asked 4 months ago
0 votes
1 replies
How to turn vulnerable sql queries into parameterized queries PHP [duplicate]
This question already has an answer here: How to fetch all in assoc array from a prepared statement?...
0 votes
0 replies
How to pass ImageMagick parameters to PHP Imagick?
ImageMagick is using dominantcolor to grab colors of an image and it is using some parameters like mode for excluding colors like white or black...
asked 4 months ago
0 votes
0 replies
PHP Browser detection
Rather confused by this. I'm using Chrome and my $_SERVER['USER_AGENT'] is returning this; Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) Apple...
asked 4 months ago
0 votes
0 replies
How to fix error 127 when running NPM from php environment using exec()?
I'm trying to bundle scripts via NPM in a PHP environment using the exec() function. Whatever setup I try, I keep ending up with a 127 error code...
asked 4 months ago
0 votes
2 replies
Read specific line from csv file on php [duplicate]
This question already has an answer here: Skip the first line of a CSV file 8 an...
asked 4 months ago
-1 votes
0 replies
MAMP is behaving strangely - downloads a file on some websites
I have several websites locally, I am using MAMP (mac). Some of them opens perfectly. One opens if I write http://localhost:8888/mywebsite/index....
asked 4 months ago
0 votes
0 replies
I got an error about PHP Deprecated Warning [duplicate]
Im trying to load my model in my controller and tried this: return Post::getAll(); got the error Non-static method Post::getAll() should not b...
asked 4 months ago
2 votes
3 replies
Reassignment of a variable referencing an array reassigns the original variable
I have this code: $originalBar = [ 'baz' => 18 ]; function modify (&$bar) { $bar['test'] = true; $bar = [ 'data' => 42 ];...
php
asked 4 months ago
0 votes
1 replies
Getting last value from multidimensional array outside foreach loop
So I'm updating a database table and I receive a array from the input because there are multiple values (id[] , price[] , product[] , description...
asked 4 months ago