Skip to content

Tag: php

Stripe checkout is not working

We are use stripe payments method in a php script. We are getting the following error: Please suggest how we can fix it Answer You created the charge with amount=1. As the error message explicitly says, the minimum amount is 50 cents. All amounts in Stripe’s API are in cents, so amount must be at least …

Calling a PHP function on button click?

I have a html button which has an onclick method. The function which is ran onclick has a php function in but is called in JS, like below. The page this code is on is a wordpress admin page. When the page loads, the php function is ran anyway instead of waiting for the button click event. Is there a

Session sweeping lottery

Can someone explain what a session sweeping lottery is? I’ve attached the default session config file for the Laravel framework. Questions: 1. It says that some session drivers must manually sweep their storage location. Could someone describe this process and why it is necessary? What session drivers r…

Run powershell in PHP with new-Object

I have to manage a cash register from PHP. If I run the following commands via cmd there are no problems. The cash register print the string perfectly. I write the commands in this order: The problem comes when I try to do this from php. I created a web server ( XAMPP ) to ensure that it can send

preg_replace get each two characters from a word

Actually I’m trying to come up with a way of getting a string like “GEWO” out of the “Get Word” by using preg_replace function. The thing is there also can be a strings like “Get”, or “Get Word And another Word” so I have to get the proper string respectiv…

Laravel 5.2 New Password Must differ from Old One

Currently I am working on one project’s authentication module. I want to create functionality of password reset with the constraint that new password and old password must be different. But the problem is, the password is encrypted with bcrypt in database. So I can’t use Different validation rule …

How to get all pending jobs in laravel queue on redis?

The queue:listen was not run on a server, so some jobs were pushed (using Redis driver) but never run. How could I count (or get all) these jobs? I did not find any artisan command to get this information. Answer If someone is still looking for an answer, here is the way I did it: $connection is the Redis&#82…