In Symfony 2 there are two main ways to define configuration options for a bundle. The first way is to simply define parameters in the service container and the second is to expose semantic configuration for your bundle. more…
PHP Articles
Unvalidated Redirects and Forwards Security Vulnerabilities in PHP
Unvalidated redirects and forwards are when an application uses untrusted data to redirect a user to a new webpage. This poses a security threat since an attacker can use the application to redirect unsuspecting users to a malicious site in a phishing scam. more…
Preventing SQL Injection in PHP
SQL Injection is a vulnerability that allows an attacker to insert or inject a SQL query into an application. Injection is number one vulnerability on the OWASP Top Ten list for 2013. Common ways to exploit this vulnerability is to add a SQL statement into a form element or by sending POST/GET requests with the query using known parameters. The risk of SQL injection is loss or compromise of critical or sensitive data. more…
Include Javascript or CSS to a Drupal Form using #attached
If you’re creating a form using Drupal and find you want to add some javascript or CSS then you can use the “#attached” attribute to do so. Using “#attached” you can include local javascript/CSS files, external javascript/CSS files, or inline styles and scripts. more…
Update a Drupal Module’s Database Schema Using hook_update_N
Drupal allows a module developer to easily define a database schema using hook_schema but this won’t work if you need to update the database schema during an update to the module. Fortunately, there is a nice hook in Drupal called hook_update_N that you can place in your module’s .install file. more…
PHP and the Elvis Operator
In PHP the ternary operator can really help clean up your code, especially for short conditional assignments. The ternary operator can help improve the readability of your code as well. Someone recently enlightened me and showed me the Elvis operator and it’s usage for simple assignments. more…
Reset Password for Users in Drupal Using Drush
A lost password can be a real headache, especially if it’s the admin account for an installation. It is possible to login without credentials or reset a password for any user from the command line using drush. more…
Scroll Back to Top WordPress Plugin
Scroll Back to Top is a WordPress plugin to add a button that appears only when users scroll down the page allowing them to scroll to the top of the page. The plugin comes pre-configured and is fully functional on activation. The plugin offers a number of webmaster-friendly features to completely customize the look, position, and animation. more…
Scroll Back to Top WordPress Plugin Button Designs
The WordPress Scroll Back to Top plugin is extremely flexible and can accommodate nearly any design to match an existing website. By adjusting a few simple configuration options you can easily adapt the plugin to your site in minutes. To give you some inspiration for different scroll to top button ideas and to illustrate how simple it is to change the design I have a few screenshots of the button in action along with the settings needed to execute the design. more…
Managing WordPress Roles and Capabilities
The WordPress permissions system is pretty straight forward, each task a user performs on a WordPress installation requires the capability to perform that task. These capabilities are how a WordPress installation can allow authors to write articles but not edit plugins, or allow editors to manipulate content but not change a theme. more…