Do htaccess Rules Cascade

Do htaccess rules cascade into subfolders

Do htaccess rules cascade into subfolders within your website?  By default they do.  However they do not cascade the same way that many of us might think they do.  Let’s explore how the cascading rules apply. In CSS, it is easy to learn the cascading rules by simply taking the farthest to closest approach.  Rules […]

WordPress and jQuery – Get by Element ID not working

I racked my brain on this one for a bit the other day.  So I figured I would make a post on it to hopefully help some others. During my development of a WordPress plugin I was having trouble with WordPress and jQuery working together.  In particular, having jQuery interact with a Form element inside of […]

PHP Script to validate an Email Address

I do a lot of programming that requires validation of user data – including a users email address. When I am collecting this data via a Web Form, I like to use the JQuery Validate plugin to give immediate feedback to my user when they have not entered an e-mail address properly. In addition, I like […]

Circular Arrow

PHP Array to Object and Object to Array

In your php applications you may find many circumstances where it is needed to convert an object into an array and an array into an object. One common example of this usage is in Server <-> Client communications.  The server may want to store items in an array for sorting and iteration.  By contrast, the […]

Random Numbers

PHP Script to generate a random salt

There are many times and circumstances in your programming that you may need to write and generate a random salt.  This may be include: Creating passwords for users Coupon codes Random identification strings When this is needed, many programming languages have a default random function of some kind.  For example, in PHP you have RAND […]

Padlock Icon

Using a hashing algorithm to validate a password

Security on your website is a critical detail to pay close attention to.  This post will help you use a hashing algorithm to store and validate user authentication details, such as passwords. If you have a site that stores user authentication data, you will want to use a hashing algorithm to store and validate the […]

stop words

PHP Array of Common Stop Words

There are many different circumstances in which a PHP Array of Common Stop Words could come in handy. One of the most useful is if you have some sort of blog, article or page creator in your website. Using meaningful titles in the URL is a strong strategy to increase your SEO results. However you […]

strpos false positives

php strpos function returning false positives

I came across an issue with the php STRPOS() function today that I just had to share.  Well – ok, the function acted as designed, although it’s default behavior is not what I would have intuitively guessed.  Oh the excitements of a programmer 🙂 The issue was that I had a code routine using STRPOS() that […]

php-short-code-conversion

PHP Short Code – How to Change to PHP Long Code Syntax

The other day I ran into an interesting problem.  I had to convert an entire code base from using PHP Short Tag syntax, to using their Full Tag syntax.  This post is created to share how I did it in case others need to do the same. What are PHP Short Tags a.k.a short_open_tag? PHP […]