Have you ever wanted to know how many lines of code your web application consists of? I have. To find out, I created a recursive function in PHP to count the number of lines in files relating to my web application. Since your entire web application is likely to reside under one directory (that's the assumption I use in this article), we can count the number of lines in each file, and disinclude any files that don't have the file extensions we're looking for. For example, the sy... Read more.
Cross-Site Scripting (XSS) is a type of attack where a hacker attempts to inject client-side scripting into a webpage that others are able to view. The attack could be as simple as an annoying alert window or as sophisticated as stealing a logged in user's credentials (commonly saved in browser cookies). With a user's credentials, a hacker could gain access to sensitive parts of your website or web application. In this simple guide, I'll show you a few ways to protect your webs... Read more.
HTML forms make up a large part of the web. They are the primary method for retrieving input from users. Typically, you fill out the form, click the submit button, and be redirected to a thank you page. For web applications, this may not be ideal - you may not want the user to leave the page. In this article, I'll show you how to use jQuery's AJAX function to submit a form asynchronously to the server and avoid a redirect.
A Simple Contact Form
Here's an example of a simple contact... Read more.
I recently wanted to display my latest tweets on my website since I am trying to use Twitter more regularly. Until I was able to do this, I knew nothing about Twitter or its API's and I didn't really feel like researching it much either. I wanted a quick solution and a simple google search lead me to Nick Heer's blog post Display Your Latest Tweet With PHP. Nick cites that he pulled the code from Smashing Magazine, but Smashing Magazine actually got it from Ryan Barr at Sc... Read more.
Every once in a while, I'll be posting some tips on web development. These are tips I may have gotten from the web or from my own experience, and they could be on anything related to web development. So without further ado, here are the first tips of many to come!
Tip #1: Using jQuery to "Check All" checkboxes in a list
This is a handy tip I've incorporated in many of my projects. If you have a list of checkboxes, it's nice to give the user the option of checking all the boxe... Read more.