Category "php"

Respond with status code 401 on authentication failure using Laravel and Passport?

I'm configuring a Laravel project to use Passport token authentication. Everything seems to be working, but when the auth:api middleware fails, it responds to t

How do I enable error reporting in Laravel?

I'm using Laravel 5.2 and I'm trying to import an excel sheet which contains more than 18000 records. the error below appeared. The localhost page isn’t w

Store multiple fields in JSON column (Nova CMS)

I have a posts table that has a json column "read_more_section". And I want to store on that column the information regarding some fields on the NOVA CMS (title

Display the default discounted price and percentage on Woocommerce products

I am trying to display the percentage discount of a product on Woocommerce. The solution originally provided (linked below) works, however the discount percenta

Convert php and mysql web application into offline desktop application

I have made a web application with php and mysql in wamp server. Now i want to convert it into desktop application for windows platform which will run offline a

passing parameters in form using laravel8 route

<form action="{{route('products.update',$products->id)}}" method="post"> this code make this error: Property [id] does not exist on this collection in

Edit product hook WooCommerce

On my product template, I execute this action : <?php /** * woocommerce_single_product_summary hook. * * @hooked woocommerce_template_single

I want to display a sweetalert after the inserting of data in my database

This is my php code of inserting data in mysql and displaying sweetalert after insertion but the sweetalert is not displayed. <?php if(isset($_POS

PHP password_verify

I am working on making a login section for my project website using PHP, but for some reason, verify_password won't return true, even when I am giving the corre

How can i hide dt if dd got empty value

I need to hide dt if dd got empty value. how can i do that? <dt class="col-sm-6 text-dark" >Subject</dt> <dd class="col-sm-6">{{$course_

PhP how to calculate moments with variables rows

I have 45 - 50 array rowss that are deserialized json return values in standard PhP array string format, from cURL with data that looks like the following: Arr

Custom API and cunsuming in php?

I want to write Web services(REST) and Consuming using Curl in php. $books = array( "java"=>"222", "php"=>"333", "c"=>"111",

Unable to send a Base 64 image to Woocommerce /product API with JS

I am actually trying to make a 3D product configurator with verge 3D and have to create new WooCommerce products for every specific product configuration. Every

Return multiple values from a function using mysqli_fetch_assoc [closed]

How do I return multiple values from the array returned from mysqli_fetch_assoc() in the code below? function db_query($sql){

Warning: A non-numeric value encountered

Recently updated to PHP 7.1 and start getting following error Warning: A non-numeric value encountered in on line 29 Here is what line 29 looks like $sub

Laravel/ PHP: Order By Alphabetical with numbers in order [duplicate]

When ordering things by Alphabetical Order, I'm left with this: S1 Episode 1 S1 Episode 11 S1 Episode 12 S1 Episode 2 S1 Episode 3 S2 Episod

How to send upload image through email

I need to be able to send image that is uploaded into form when hit submit it sends email. The problem that is happening is it sends email with text but photos

Star rating with half star support

I am running into a problem rendering a star rating and was hoping I can get some extra eyeballs on my problem. I have the normal rating working just fine with

How to get AJAX to post on second page?

This is what is happening: I send data but and I have it coded to echo out on second page. However, it just echoes out on first page. How do I make it so it ech

hidden INPUT value not available in $_POST

I have a form that I use JavaScript to set the value of a hidden INPUT field which is the text of the OPTION selected. The $_POST captures the value of the OPT