Skip to content

Where is the preload.php file, and how is it generated?

With Symfony 5.1 and PHP 7.4, I want to add preload.php in opcache. Symfony documentation : During container compilation (e.g. when running the cache:clear command), Symfony generates a file called preload.php in the config/ directory with the list of classes to preload. opcache.preload=/path/to/project/confi…

PHPWord not saving file in /tmp directory

I am trying to run PHPWord’s basic example in here on my Mac. I am using XAMPP as app server. I only changed the require_once part and added sys_get_temp_dir() in front of the file name because of the “ZipArchive::close(): Failure to create temporary file: Permission denied” error as same as…

How to check duplicate but without refresh page? PHP

this is my coding. I want to check the duplicate data. If duplicate data exists, the alert will pop-out, but once I click on OK, it will go to a blank page and cannot return to the form. How to make it pop-out an alert but without refresh the page? Answer One of the solutions is to do a javascript

MySQL SUM of multiple rows from multiple table

I am trying to get the sum of multiple rows from 2 different tables, but somehow the result returns multiple rows. I need to get the SUM of quotation_item_amount (group by quotation_id) and invoice_item_amount (group by invoice_id) and if I query unpaid quotation, I need to get WHERE SUM(invoice) < SUM(quo…

string to xHH in PHP

I am curious is that any build in or easier way to encode string to xHH format in PHP? I am trying to implement rule 3 and rule 4 from XSS OWASP Prevention with build in function or easier approach. but, I can’t find any in the internet. as far as I found, I need to make manual encoder/decoder for