January 2009

PHP: Checkbox Array in Form Handling – Multiple Checkbox Values in an Array

Checkboxes is probably one of the most frequently used form controls which come handy in dealing with one to many relationships. The multiple selective nature of HTML form checkboxes require a convenient way for PHP to process multiple checkbox values, ideally in a single array. By default, each and every HTML input control including checkboxes …

PHP: Checkbox Array in Form Handling – Multiple Checkbox Values in an Array Read More »

.htaccess: Deny From All – Prohibit, Forbid or Restrict Directory Access

Restricting directory access might be one of the most frequently used .htaccess techniques out there. As a site grows, there always are some areas that you don’t want visitors to look at such as merchandise warehouse where you store digital products for sale. You want a programmed server-side script to serve the download after confirming …

.htaccess: Deny From All – Prohibit, Forbid or Restrict Directory Access Read More »

.htaccess: Directory Listing — Enable Web Directory Browsing & Indexing

One of the best things I love Apache web server is that it instantly enables you to share files and resources via plain web directory index listing without having to spend time making any fancy web pages to serve them. However, there are times when you need to hide things out. To disable web directory …

.htaccess: Directory Listing — Enable Web Directory Browsing & Indexing Read More »

$6.99 .com domain coupon at GoDaddy for both registration and renewal

Update: Here’s the latest coupon code of Godaddy – $1.49 / year .com A quick short post for my fellow readers. If you have quite some domains with GoDaddy, you’d know that ever since they raised the price for .com by $0.5, to find a $6.99 .com GoDaddy domain coupon is rather difficult now. Most …

$6.99 .com domain coupon at GoDaddy for both registration and renewal Read More »

PHP: Escape String Literals for SQL, mysqli::real_escape_string and PDO to Prevent SQL Injection Attacks

To successfully run a query with text data containing single quotes ‘ as well as other SQL reserved punctuations, AND to prevent SQL injections, you will always want to escape the text values before using them in a SQL query. In PHP 4.0, we are stuck with mysql_real_escape_string. With PHP 5.0, mysqli:prepare and mysqli::real_escape_string are …

PHP: Escape String Literals for SQL, mysqli::real_escape_string and PDO to Prevent SQL Injection Attacks Read More »

PHP: Prevent SQL Injection Attacks

SQL injection is a typical code injection attack that exploits weaknesses of application in the database layer. SQL injection vulnerability is created when one scripting or programming language is embedded in or used as input in another with failure to verify the legality or filter for potential dangerous codes. SQL injections are possible when input …

PHP: Prevent SQL Injection Attacks Read More »

Top 25 Most Dangerous Web Programming Errors, Loopholes and Bad Habits

As Web becomes one of the most fundamental means of communication and information delivery nowadays, and as its usage reaches population level in regards to that when the televisions prevailed, the protection of it has never been so critical. SANS institute in association with US government and various other weighty contributors, most of whom IT …

Top 25 Most Dangerous Web Programming Errors, Loopholes and Bad Habits Read More »

Rackspace Cloud $50 Promo Code (Coupon Code for Cloud Servers Discount)

Bad News: Partners program manager of Rackspace Cloud, Kenard Horsley informed me via email that they have made the decision to end the $25 discount for Cloud Sites on 18th, March (2010) and instead focus on Cloud Servers promotion. The promo code (Promo Code ID=134) will be effectively invalidated by then. The Promo or Referral …

Rackspace Cloud $50 Promo Code (Coupon Code for Cloud Servers Discount) Read More »

HTML CSS Drop Down Menu Made Easy – SuckerFish Enhanced

There’s a pure css drop down menu named SuckerFish published at ALA. Really straightforwardly clean code and simple drop menu script, however it might be friendlier for developers if it’s combined with the li:hover hack for IE6. The HTML: <ul id=”nav”> <li><a href=”#”>bodycare</a> <ul> <li><a href=”#”>lotions</a></li> <li><a href=”#”>creams</a></li> <li><a href=”#”>balms</a></li> <li><a href=”#”>butters</a></li> </ul> </li> <li><a …

HTML CSS Drop Down Menu Made Easy – SuckerFish Enhanced Read More »

Create SQL Auto Increment Column (ID: Primary Key) in Table

With database development, a perfect data structure paradigm is that data records should all be uniquely distinguishable from each other. Therefore when you are designing and creating data fields or columns for an entity, you must always have an identifying column or field for each and every of the records stored in a table, enabling …

Create SQL Auto Increment Column (ID: Primary Key) in Table Read More »

PHP: File Upload Script (HTML Form + PHP Handler Class)

It’s sometimes cumbersome to handle uploaded files — checking if it is really uploaded, moving and renaming. Why not writing all these chores into a class and make our own file upload script? First we are going to create a simple class to handle uploaded files and move them to some place we designate for …

PHP: File Upload Script (HTML Form + PHP Handler Class) Read More »

PHP: Resize Image and Store to File

While there are a lot of methods for you to resize images with php, we will be using extension gd this time. Make sure you or your hosting company has installed it in the php distribution by running <?php if (extension_loaded(‘gd’)) { // return true if the extension’s loaded. echo ‘Installed.’; } else { if …

PHP: Resize Image and Store to File Read More »

Update your theme to WordPress 2.7 with Comments Threading and Paging

Well dismiss me if I’m a little too late for this but just now I encountered this client who needs to update a wordpress theme, the comments section or comments.php to be precise, to accommodate some of the new features introduced in WordPress 2.7, comments threading and comments paging. The easy way — for new …

Update your theme to WordPress 2.7 with Comments Threading and Paging Read More »

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax …

Scratching your head for a mystic error in your SQL query? No matter how you look into it, it just seems right and should by the God’s name work as you have wished. But it doesn’t and keeps pumping out annoying SQL syntax errors. Don’t panic, I have a few tips on this that might …

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax … Read More »

Scroll to Top