Category "php"

Mailjet API: how to add template parameters?

I use the Mailjet API PHP library. And I want to send an email with a template. How can I add template parameters to my function sendEmail? Thanks

Limit login attempts in Laravel 5.7

I have Laravel 5.7 project with custom login. How can I let Laravel accept three login attempts after that redirect for page waiting to 2 or 3 min, etc? public

Add a text next to stock quantity if it is less than 10 in Woocommerce single product

I found this posted as a comment on another thread but I don't know what I'm supposed to do with it: if($product->get_stock_quantity() <10){echo 'Limit

How to get monthly wise data in laravel

I have a lot of data. I want to bring the data from the database as a monthly wise. I have already used group by method but when I want to view the data all the

How to create a video stream from a single dynamic image in PHP

I have a single image file on my server which its content changes every 100 ms. I can load and serve this image as usual: $image = file_get_contents('path/to/im

How to validate Envato Purchase Code in PHP

I'm working on Envato API to verify Purchase Code I used plugin sample code from GitHub https://github.com/codehaiku/Envato-Purchase-Code-Verifier here I added

if statement inside concatenation

If the user is verified then a verified icon must be shown next to the comment author <?php if($data->verified): ?><i class="fa fa-check-circle">

WordPress + Nginx on non-standard port behind AWS ELB results in broken links

We have a Nginx listening on ports 80 and 443 and serving our main website. Let's say its name is demosite.com. It is running on AWS EC2 instance, and traffic

Form repeater send wrong data with last element in Laravel

My form sends multiple forms of (name and image). However, the last element sends a name only with the wrong 'name.' Do I need to simultaneously make multiple i

How active a function with time interval PHP | Codeigniter 3

There's a way to call a function every minute? i have an API call from my codeigniter controller with cURL, can php call that function every min?

How to reset Laravel AuthManager/guards in between API calls in tests?

I'm writing a Feature test for an API and I want to test custom auth logic. I know that when I call the login API endpoint, Laravel caches the fact that the use

PHP echo values of all sub keys [duplicate]

In the following array: "options": { "front-electric": { "pt": "Vidros Eléctricos dianteir

Converting alphabet letter to alphabet position in PHP [duplicate]

$my_alphabet = "T"; The above character "T" should print the exact position/number of the alphabet. i.e 20 So, if $my_alphabet = "A" ; I sho

Custom post type single page not working

I have aj-fashions custom post type. technically i tried to show the loop of all post in a template file named fashio-template.php and now for the single post i

Smarty if isset

Okay so I have some PHP code but I have recently changed to smarty. And I was wondering how I convert that PHP code to smarty code. PHP CODE <?php if (iss

How do I Post to .txt document before form submits

What I am trying to do is before I submit a form to Mailchimp with someones email I want to write that email to a .txt file. Mailchimp is using a "get" for the

If action is on a different page do I use fwrite function

I have a form that has an action of a GET on another page.. IT also has a post method that I am using to write form data too .txt file.. When I have an action o

Add bold text and line break into Laravel Notification Email

Laravel 5.6 I'm attempting to send a Laravel Notification via email. I want to make make some of the text bold, and put in line breaks, without a whole new pa

How can I create a Download Page with post php method?

I want to know that how can I create a download page in PHP that download files without reveling the download link to the file, and source to the file and downl

Want to protect file from copy,download

I have following requirement. Admin can upload any files like jpg,pdf,PPT,DOC file on server. End User or viewer only access the files in display/view mode.