Questions tagged [php]

PHP is a widely used, open source, general-purpose, multi-paradigm, dynamically typed and interpreted scripting language designed initially for server-side web development. Use this tag for questions about programming in the PHP language.

Filter by
Sorted by
Tagged with
0 votes
0 answers
10 views

How to fix eror unable to make protected java.lang.object java.util.abstractmap.clone()?

when I want to print a report using ireport an error appears "unable to make protected java.lang.object java.util.abstractmap.clone()", how fix this eror?? enter image description here i ...
-1 votes
1 answer
15 views

How can I convert this php code to node.js

`<?php header("Access-Control-Allow-Origin: *"); header("Access-Control-Allow-Headers: *"); error_reporting(0); $url = "https://test.com/api.php"; $Key = "...
  • 1
0 votes
0 answers
11 views

How to create a table in MariaDB database using PHP

I am totally lost with this. Relatively new to both PHP and Mysql. Just trying it to learn something different. What I am trying to do is create new table in a database named demo. User being used ...
-1 votes
1 answer
12 views

extracting specific integer value from mysql table using php in moodle

I need to extract a specific value from a table knowing the id of the row in moodle screenshot of the table I tried previously to get the variable from another php class but no matter what it gives ...
0 votes
1 answer
10 views

PHP cURL not showing all DOM tags at review collecting

i wanna implement a little code, that collects the reviews from the specific page DOM. The cURL result not full, and i don't know why, because some sub tags in the DOM is invisable in the result. The ...
0 votes
0 answers
7 views

Access JSON properties in PHP

I have a URL (https://randomuser.me/api/) which I access using the CURL....it returns the JSON: HTTP/2 200 date: Sat, 25 Mar 2023 20:41:58 GMT content-type: application/json; charset=utf-8 x-powered-...
  • 406
-1 votes
1 answer
13 views

How to Paginate More Than 1 Array? PHP

I have Three Arrays.. I want to make this 3 Arrays to have 20 result per page, each of it.. Array 1 $Array1 = Array ( [0] => 86456 [1] => 86456 [2] => 86456 [3] => 86456 ...
-4 votes
0 answers
18 views

Found a block of obfuscated PHP code in a client project. What does this do?

No idea what this does. It's in the main index.php file for a 15 year old small business website that I'm repairing. <?php $O='J_KLVABC12abc:fghiPQRjklmn/op-qrMNOst.uvw<xyz3DEFSTU=de789GHIWX?&...
  • 137
0 votes
0 answers
10 views

Calling a Python script from PHP and outputting data back to PHP

I have written a simple API in PHP that needs to receive webhook payloads, pass a value to a python script, which will then access a web service via a SOAP client, and return data to the PHP file. So ...
  • 59
0 votes
1 answer
10 views

Regular expression in PHP, with range of characters, but that excludes specific ones

I'm trying to create a regular expression with preg_match that can detect a string with the following requirements: Must contain at least 10 characters. There must be at least one of these: / (slash) ...
0 votes
0 answers
5 views

Doctrine n+1 issue with ManyToMany relation despite using EAGER loading

I am testing out API Platform and I am running into n+1 issues with Doctrine. I have an entity called Car which has a ManyToMany relation with Driver. I have not done anything custom, I am just ...
0 votes
0 answers
7 views

How do I import posts into a new wordpress site if post ID starts at 26?

I want to use the WordPress export tool to export my posts from an old site. My concern is that the post ID in the old db starts at 26 and the destination database which is a fresh install obviously ...
  • 121
-2 votes
0 answers
32 views

What cookies are allowed without permission? [closed]

I'm programming with php and for security when loading the main page with setcookie() I want to put a user id in a cookie and save it in your browser. I have been searching on stackoverflow and many ...
  • 7
0 votes
0 answers
12 views

How to access GitHub Actions runner after CI/CD?

I'm trying to deploy a PHP/MySQL app using GitHub Actions by implementing a CI/CD pipeline and unfortunately I cannot access the containers inside the runner, even though the pipeline executes ...
  • 27
-3 votes
1 answer
24 views

PHP Script not INSERT-ing values, but still skips AUTO INCREMENT

I try to do insert via a PHP script, I get no errors and the syntax should be perfect, but it still does not get inserted into my database. I test the same query in MySQL workbench and it works ...
-1 votes
0 answers
9 views

Tesponse data must not be correct Tau-prolog.js

CODE PL I am using the prolog interpreter in javascript tau-prolog I see that there are not many references and clear examples of use. The problem is that it shows the response in an unexpected format ...
-2 votes
0 answers
18 views

Login if username and password exists in database

Below is what my php code looks like. I am trying to make the user login if there username (shark ID) is there in the database(phpmyAdmin). The code does not seem to work. mysqli_query is returning ...
  • 1
0 votes
0 answers
29 views

My form needs to be clicked twice to submit, what can be wrong?

Here is my form code: <div id="contactform"> <form action="forma.php" method="POST" id="myform"> <div class="row"> <div class=&...
-2 votes
0 answers
19 views

Editing the loop code for WordPress (to add a slider)

I use wordpress. I want to put a slider for the single page. Slider code from the site: http://www.menucool.com I have downloaded it, it works well and I want to add this slider to my site template. ...
  • 226
0 votes
0 answers
22 views

Does a final class declaration affect the performance in PHP?

Prologue: There is a discussion whether or not it is a good habit to declare classes as final in PHP by default. Personally I tend to trust the developer team and use final only in edge situation, e.g....
  • 6,273
0 votes
0 answers
6 views

OnChange event is not working in magento 2

I have to make the dropdown searchable where the dropdown options would be based on the users input i have to use jquery to trigger the search function whenever user types any letter in the dropdown ...
0 votes
1 answer
19 views

laravel data saving for 5 users

how do I make each user have their data saved in their respective tables in laravel after registration? After registration, each user has their data held in the same table while they should be held in ...
-3 votes
0 answers
23 views

SQLite3 is giving me prepare errors

I'm getting these errors when I use SQLite3 Prepare statements. Warning: SQLite3::prepare(): Unable to prepare statement: 1, no such table: users in /Applications/XAMPP/xamppfiles/htdocs/web_tech/...
-1 votes
0 answers
5 views

Not able to change the controller from the default in php mvc

I am new to php MVC and ran into some problem. I have a default controller called pages but due to some reasons I am not able to change it to a different name. CORE.PHP-> here all the controllers ...
0 votes
0 answers
9 views

Add h3 element as linktitle after parse

I have a functioning script that will extract links from box.com However I'd like to use the "title" given in the "h3" ( h3 class="files-item-name ) tag, instead of the ...
-1 votes
0 answers
7 views

php project theme view not showing code not execute

this type show plz help Just use style.css and the basic files until you can see it. While troubleshooting
-1 votes
0 answers
16 views

Warning: mysqli_connect() [function.mysqli-connect]: (28000/1045): Access denied for user '3307'@'localhost [closed]

Hallo zusammen und zwar habe ich hier ein folgendes Problem ich bekomme meine PHP Webseite nicht mit der Datenbank verbunden. Mit C# und Windows Forms hat es aber geklappt. Die PHP Webseite konnte ich ...
-1 votes
0 answers
20 views

Login with a function

Is it secure to use a function for my login system. For example, rather than: $Hash = 'foo'; $Username = 'Username'; $Password = 'Password'; if password_verify($Password, $Hash) == true { echo '...
-2 votes
0 answers
29 views

unable to run php file in terminal (access denied)

i have the following php file named insertion: <?php // Set up database connection $servername = "localhost"; $username = "root"; $password = ""; $dbname = "panne&...
-2 votes
0 answers
13 views

I'm looking for some PHP code that read FLAC files [closed]

I cannot find any PHP code in Internet for FLAC files, I'm not going to decode them, but just read frames and send them to decodebuffer of web audio API. That magic function will decode (I think) FLAC ...
-1 votes
0 answers
20 views

Illegal string offset 'size' in

I'm getting following error Warning: Illegal string offset 'size' in /var/www/vhosts/manurefetish.com/httpdocs/wp-content/plugins/all-in-one-video-gallery/public/templates/category-thumbnail.php on ...
  • 1
0 votes
1 answer
29 views

How do I add an entry to a json string?

I have a query $rows = array(); while($r = $rs->fetch(PDO::FETCH_ASSOC)) { $rows[] = $r; } print json_encode($rows); resulting in [{"id":"1","entry1":"value1&...
0 votes
1 answer
15 views

Having issues with redirect

I have a wordpress site, created a plugin that creates a URL and then it's supposed to go to that URL. I created a shortcode for it as well. I have a pop-up that runs when I click a button and ...
0 votes
1 answer
32 views

Only Keep Specific words in a string

So i have a string which will be a location such as: 'Lawrence Street, York, YO10 3EU, United Kingdom' 'York, YO10 3EU, United Kingdom' 'Hertford, Hertfordshire, England, United Kingdom' Etc However, ...
0 votes
0 answers
16 views

Custom MVC routing - limiting routes

I have created my custom MVC framework in PHP, but i'm new to PHP and to Apatche so i don't know how to make good routing system going. For now i have only some default options set in .htaccess files, ...
0 votes
2 answers
44 views

Combine elements within the array

Is there a way to combine individual elements and their subtrees within a PHP array? For instance, to convert this: $test=array("EW"=>array(313, 1788), "SC"=>array(670, 860),...
  • 221
0 votes
0 answers
18 views

How can I display code when users come from a specific referrer?

I have a code I want to display code when users come from google.com My code is <div class="col-md-<?= $col_num ?>"> <?= $this->Flash->render() ?> &...
  • 13
-2 votes
0 answers
16 views

how to view result of subresult of subresult [duplicate]

I would like to ask for support, with some specific view of results: In my SQL database I have some table, called mytable with following columns and rows: | ID | name | parentID | status | ----...
  • 1
-1 votes
0 answers
16 views

PHP form throws error "Something went wrong" even the form submission is successful

<!DOCTYPE html> <html> <head> <title>Volunteer Form</title> <style> #volunteer-form { width: 400px; margin: 0 auto; ...
0 votes
0 answers
13 views

mPDF: Downloading PDF file in live server throws 403 forbidden error, but downloads successfully in localhost server

I have written a code which will write the HTML body of a particular webpage (which I get after web scraping) into my PDF file. I am using the mPDF library for this purpose. This is the data that is ...
0 votes
0 answers
19 views

mbstring extension not enabling in PHP (windows)

mbstrings just won't enable, checked everything i could. Uncommented the line extension=mbstring, checked the extension_dir, the dll is there, php -m doesn't show mbstrings, functions don't work. ...
-4 votes
2 answers
48 views

php sql select, maybe array? [duplicate]

How can I display this data with a sql select statement? Do I need to put it in an array? I can get it formated like this $ Y Y Y Y Y Y Y N $ Y Y Y Y Y Y Y or $ Y Y Y etc.. I want 179359: $ Y Y Y Y Y ...
0 votes
0 answers
21 views

response builder in php

im writing an api that its responses is collection of using different services previously i used transformer but im thinking about this use case and i have a question that is it ok for pass different ...
  • 208
-2 votes
1 answer
16 views

remove subarrays in an array php

I have an array like this There are more arrays inside the array that I need to remove $arr = [ "4", "10" => [ [ "id" => "standard", &...
  • 1
-3 votes
0 answers
15 views

No direct script access allowed [closed]

je recois cette enter image description here erreur lors du lancement de mon serveur avec la commande php spark serve pour acceder a mon application enter image description herej'ai verifier le ...
-1 votes
0 answers
22 views

Php website files uploaded on shared hosting

Good day guys, I uploaded my php Script first I got whoops, something went wrong Then I set app debug to true and showed me an error that says: ErrorException (E_NOTICE) Trying to access array offset ...
  • 1
-1 votes
1 answer
30 views

Cannot print a static variable - affected by another constant

Given this code: class Weather { const START_DATE_HOLDER = "XXSSXX"; const END_DATE_HOLDER = "XXEEXX"; //THIS STATIC IS NOT REFERENCED BUT AFFECTS "$Q" , ...
-1 votes
0 answers
13 views

Laravel 5.5 query with groupBy('userid') works but when run from schedule

$allrecords = Records::all()->groupBy('userid'); this line in function works when run directly BUT: when run function with this line with schedule running stops in this line without raising any ...
  • 663
-1 votes
1 answer
27 views

Laravel, How to use two database tables in the same view

I have a menu view and settings view. In the menu view, you can add menu categories and in the settings, you can change name, bio, and profile picture. I want to combine all that menu view. I can ...
-2 votes
1 answer
27 views

PhpStorm, return value is expected to be 'A', 'object' returned

I have this: class A {} class B {} class X { private function create(string $class) : object { return new $class(); } public function createA() : A { return $...
  • 5,949

1
2 3 4 5
29142