Select Your Style

Choose Color style

Category: PHP

easy way to create an array and check existing value in smarty template

Smarty is a template engine for PHP, facilitating the separation of presentation (HTML/CSS) from application logic. This implies that PHP code is application logic, and is separated from the presentation. very useful in MVC architecture and used by many big cms and frameworks like Prestashop script. so to create an array you can declare it like that [crayon-5cbc11748e619657330551/] to print out smarty array value you can use the foreach loop [crayon-5cbc11748e626625209186/] the result will be [crayon-5cbc11748e628142211656/] to search value on array you can use this condition [crayon-5cbc11748e62a154604368/]   hope you learn some of smarty with me,feel free to ask for anything about smarty on comments

Read More

How to change Number of decimals in prestashop 1.7

Prestashop 1.7 come with lot of new features and major change from 1.6 version,this version based on symfony framework one of geat php frameworks. but it come with some bugs too one of these bugs is The decimals feature does not work anymore even if the feature is on the Back Office.price formating not change even you change the number of decimals thanks to an member of prestashop forum there is a solution for this, just follow steps to change the format: Step 1:  open this file using ftp and notepad++ or sublime text Translations>cldr>main-en-US-numbers  if you are using another language than english, you will find the [...]

Read More

How to remove XSS and protect your website

Cross-site scripting (XSS) is a security bug that can affect websites. If present in your website, this bug can allow an attacker to add their own malicious JavaScript code onto the HTML pages displayed to your users. It refers to client-side code injection attack wherein an attacker can execute malicious scripts  into a legitimate website or web application. XSS  is one of the most dangerous and most often found vulnerabilities related to web applications. Security researchers have found this vulnerability in most of the popular websites, so how to protect your website from XSS??? use this simple function to check input data in your php [...]

Read More

Easy method to reset wordpress admin password

an easy way to reset wordpress admin password via FTP follow this steps: 1 - Login to your site via FTP 2 - download your active theme's functions.php file 3 - Edit the file and add this code to it, after the first <?php: [crayon-5cbc117490251634577096/] "1" is the user ID number in the wp_users table, and 'password' is your new password 4 - save and Upload the file back to your site. 5 - load your website via browser then go back to the file and remove the line that you added  

Read More