Category "php"

str_replace or preg_replace random number from string

I have a url from where i am fetching value using GET method and i want to replace that value with the 4 digit random number in the string like This is my main

Assign output of PHP function to a variable

Here's my current code: function get_coins() { global $conn; $new_sql = "SELECT * FROM marketcaps ORDER BY cap DESC LIMIT 25"; $new_result = $conn-

Live search query using JS and PHP for QA forum

I am working on a QA forum using PHP and MYSQL. Now, I am creating an ask a question page like StackOverflow. In the input box when I enter a value then I get m

How to send images to Stripe Checkout Session in Laravel 8

I am having issues trying to send images using Stripe Checkout Session, I am using Laravel 8, with the Backpack Admin panel plugin. I am using Stripe's prebuilt

What is my SQL missing?

I'm learning about PHP and MySQL. I have a lab that I'm working on where I have created a database (using the terminal in Ubuntu through a Virtual Machine) and

Uncaught Error: Class "Symfony\Bundle\DebugBundle\DebugBundle" not found

I trying to deploy my application (Symfony 6 and php 8) through the Gandi.net french service. When I run the command to deploy the app by ssh I get the followin

Add and update products to session cart in Laravel

I am building a shopping cart for guests with sessions in laravel. I can add one product with quantity to the session variable 'cart.' However, when I add the s

Using PHP sessions to open new android activity

I have created the following PHP in order to check if some username already exists inside a database. If it exists and the username+password is correct, I had

laravel livewire pre selected multiple checkbox get and update value

Basically, I am trying to make a multistep form like google forms and using livewire. By saving each single page data on next click. on some page, I am trying t

browsersync doesn't work with XAMPP

I created the project at the address D:\xampp\htdocs\dashboard\optimizedphp (gulpfile.js). What kind of proxy should I use? I tried many, but after changing the

Insert And Retrieve Data in MySQL with $.post Noob Question

Trying to insert data into MySQL database with PHP. I don't want to refresh the page. The data isn't inserted when I press the Send Message button, but the data

PHP Array Conversion for Interview [duplicate]

I have an interview coming up and a previous interviewee posted that this question stumped them: we have this array: $input = [ 'item/id' =>

Why hidden input field values can't be empty

I'm using PHP form to send user registration data and then handle it with PHP form. I need to register a few user types such as "normal users," "admin users," "

The difference when using if statement true === something() vs something() === true [duplicate]

I've seen a lot of codes that places boolean in front, followed by comparison operator, and then the variable/function to test if (true === so

file_get_contents(): failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request

I am getting the error Warning: file_get_contents(https://partner.uat.shopeemobile.com/api/v1/item/categories/get): failed to open stream: HTTP request failed!

Slim\Exception\HttpNotFoundException

I'm creating a new Slim project and getting the following error: Slim Application Error: The application could not run because of the following error: Error De

Slim\Exception\HttpNotFoundException

I'm creating a new Slim project and getting the following error: Slim Application Error: The application could not run because of the following error: Error De

PHP idea about seat booking system?

I have to make a simple bus seat reservation/booking system with PHP backend. Currently I have done the interface just by using html and css as you can see from

Symfony process run throws exception - executing on command line works

I have an issue with generating PDF files using LaTeX. The solution is created with the Laravel framework (version 8). I installed a new "Windows 2019 Datacente

Laravel Collections. Is there some kind of assertStructure method?

I'm writing tests and I want to assert, that a returned collection has some specific structure. For asserting jsons I'm using assertJsonStructure() method on