Архиви на блога

Opencart losing cart on redirect after payment

Opencart has issue with Samesite session cookie which can be resolved in OC version 2.X by adding those two lines code There is a lot of info about PHP example for SameSite=None; Secure https://github.com/GoogleChromeLabs/samesite-examples/blob/master/php.md Or even in the OpenCart forums

С етикет: , , ,
Публикувано в Opencart, php

search for short open tags

If you use Linux and try to search for all php files containing short open tags you can use following command find -type f -exec grep -IlP ‘<\?(?!(php|xml|=))’ {} +

С етикет: , ,
Публикувано в linux, php

php recursive delete

This function do recursive delete on files and folders in php function recursiveDelete($str){ if(is_file($str)){ return @unlink($str); } elseif(is_dir($str)){ $scan = glob(rtrim($str,’/’).’/*’); foreach($scan as $index=>$path){ recursiveDelete($path); } return @rmdir($str); } }

С етикет: , , ,
Публикувано в linux, php

php post with big array

Starting from php 5.3.9 there is brand new config option max_input_vars which is limiting the input variables to posted arrays and etc. max_input_vars integer How many input variables may be accepted (limit is applied to $_GET, $_POST and $_COOKIE superglobal

С етикет: , , , ,
Публикувано в linux

strip first words from a string

<?php echo implode(‘ ‘, array_slice(explode(‘ ‘, strip_tags($introtext) ), 0, 30));?> …

С етикет: , , ,
Публикувано в Joomla