Categories
Development PHP Python

How to send multipart/data to PHP using Python requests

I’ve been trying to send an image to another server for a very long time, but for some reason it doesn’t want to accept files through requests. In the response, I get {“error”: “No panorama provided. Files = []”, “files”: []}. How do I build a request correctly? Correct code JS: https://gitlab.com/nickw1/opentrailview/blob/master/js/uploader.js Python POST code: […]

Categories
Cache Development MySQL PHP SQL

php7.4 mysql seems not installed

I have just installed php7.4, everything seems ok but when I try to go on my phpmyadmin, I can’t : Note works fine in php7.3 before this installation The error is : mysqli_real_connect(): Unexpected server response while doing caching_sha2 auth: 109 mysqli_real_connect(): (HY000/2006): MySQL server has gone away looking my php mysql library :php7.4-mysql. it’s […]

Categories
Development PHP

if else statement js nested inside php while loop statement – result appearing outside of loop/ not showing up

This is my code – I am trying to add a class upon a boolean result that is coming from the database. But when I run my code the echo’ing is happening outside of my loop and where it is supposed to be echo’ed is blank. I believe this to be syntax but can’t seem […]

Categories
Development PHP

WordPress – locally installed on raspberry pi not recognizing upgraded php version

I’ve updated my version of PHP to 7.0 pi@raspberrypi:~ $ php -version PHP 7.0.33-0+deb9u6 (cli) (built: Oct 24 2019 18:50:20) ( NTS ) If I display my version in WordPress it’s still pointing to the old version PHP Version: 5.6.40-0+deb8u7 tried update WordPress again still points to version 5.6

Categories
AJAX Development jQuery PHP

Perform AJAX post request to the same PHP page (Jquery Form Plugin)

I’m writing a new web interface using JavaTMP that is an AJAX based admin template. After spending some time on understanding how it works i created a page with a form that will allow you to create a new project in my software. Basically using php it will be pretty easy to create a form […]

Categories
Cache Development Linux PHP

How to install PHP 5.3 on CentOS 7 (troubleshooting propose)

I would like to install PHP 5.3 version in CentOS 7 for development propose. I know this PHP version has security problems but I need to validate why a bug happens with this version of PHP with a proprietary software. Is there any way I can do this? I’m using Docker images to run the […]

Categories
Development PHP

Get with PHP Array Tree Values Recursively with start and stop limit level

I am making a module for creating navigation menus and I would like to give the possibility to set an initial and final level. I have this array tree with level how can return it setting a start level and stop level ? this is my function that return empty. Original Array: Array ( [0] […]

Categories
Development HTML PHP SQL

Insert into sql table with php from html form

I am trying to insert into my table (courses) in my sql database. But when I run my code (by clicking submit) I get this error: I am no longer getting an error, I get the message: New course created successfully But when I check the database, the course has not been added This is […]

Categories
Development PHP

show all session with diffrent name and one suffix in php

i want to create a shop site by laravel. i want to create cart page and cart page showing all product that user want to shop it. i create a session for every product that user want to shop. i have some session in laravel like this $_SESSION[cart_133] = [ ‘product’ => ‘test1’, ‘quantity’ => […]

Categories
Development GitHub PHP

PHPUnit + Selenium `InvalidArgumentException: Element not found`

Following example from here, trying to implement some Selenium testing. Test class code: class StackoverflowTest extends \PHPUnit_Extensions_Selenium2TestCase { protected function setUp(): void { $this->setHost(‘localhost’); $this->setPort(4444); $this->setBrowserUrl(‘https://stackoverflow.com/’); $this->setBrowser(‘chrome’); parent::setUp(); } public function onNotSuccessfulTest(Throwable $e): void { $filedata = $this->currentScreenshot(); $file = __DIR__ . ‘/’ . time() . ‘.png’; file_put_contents($file, $filedata); parent::onNotSuccessfulTest($e); } /** * @test */ […]