Posts

SEO Tips for Small Business Owners

Search engines do not discriminate between small and big businesses. This makes Search Engine marketing a level playing ground, where size does matter – Size of your marketing acumen!! In your pursuit of gaining supremacy in the realm of Search engine marketing, Search Engine Optimization (SEO) will act as a potent tool. Not only does SEO help in reaching to a wider audience, it is also the most economical Online marketing tool available, a tool that will help small website owners take on the Goliaths in their business domain. Whether you want to do the SEO of your site yourself or hire an SEO firm, understanding the SEO strategies is very essential. In this edition of our newsletter, we will discuss 5 essential points that every small website owner must remember while carrying out SEO of their websites. Dealing with the technicalities Site map : Making a site map for your website is very necessary as far as SEO is concerned. It shows the position of all the relevant...

PHP Payment Library for Paypal, Authorize.net and 2Checkout

If you are like me, whenever you need to work with a 3rd party API or a gateway, you’d first search in Google for a possible wrapper for it in PHP. When it comes to supporting payment gateways, you get bunch of libraries in the search results who are fundamentally different. Some of them are old PHP 3/4 ones, some are new, some may need PEAR, etc. As they were not required together in one single project, I used them whenever needed. But in one project, I needed them all. I thoughts it’s a chance and decided to stop using them and wrote my own ones where I can use the same methods for all the gateways So, here is an abstract PaymentGateway library which is being extended to be used for three popular payment gateways ( Paypal , Authorize.net , and 2Checkout ) in order to provide you with a similar way of using them. Note that the libraries are for basic usage only and do not contain options for recurring payments. Without much babble, let’s see a few examples of how you ca...

bad word filter script in php

This is a simple file based bad word filter PHP function. The function offers a variety of options. You can choose how many letters of the bad word you wish to keep, which character you want to use as the badword "bleeper" as well as a rating for the bad word. The bad words file would be formatted like this: 9   badword 2   anther badword 7   A bad word Phrase 7   YetAnotherWord The first character number is the bad word "rating" the higher the number the worse the word. This can be useful in say, a forum situation where a user can specify their bad word tolerance. So if I pass the function a bad word tolerance of 5, the function will only remove words with a tolerance rating higher than 5. A sample function call would look like this: $myString = "This is a sentence with some badwords, It is an example based on the Yetanotherword file above."; echo filterBa...

Watermark Images with Text Using PHP and GD Library

Image
Hi This code snippet allows you to watermark uploaded images on the fly. The script saves the uploaded image in the specified location, the prints the specified message (for example a copyright notice) on the image and saves the watermarked image as a JPEG file in another location. You can use this script to copy-protect your images by permanently imprinting a copyright notice on the image. Though the example script covers most general needs, PHP programmers should customize the script for their needs. The Complete Example The working code sample consists of the following items: HTML form that posts an image to the PHP script The PHP Script HTML Form The HTML form needs a file upload element :< input type="file"> . You must also specify the correct encoding type:  enctype="multipart/form-data"  for the form. <form action="watermark-image.php" method="post" enctype="multipart/form-data">  Select a file to upload for pro...

What is LAMP

What is LAMP? LAMP includes a stack of software, mostly open source and free software, used to run dynamic websites or/and servers. What is the advantage of LAMP and why should we use LAMP? LAMP involves a combination of open source programs. LAMP allows for lower cost development and when the programs are used together they support application servers and development environments such as Java/J2EE and Microsoft.Net. The combination in LAMP has become popular because of its low acquisition cost and because of the versatility of its components since it can be used in most of the Linux distributions. The acronym of LAMP is as follows Linux - operating system. Apache - web server. MySQL - Database management system or database server. PHP or Perl, Python - programming languages. Primarily, LAMP is a combination of the above-mentioned technologies which is used for a wide variety of purposes such to design a web server infrastructure, design a programming paradigm of developing soft...

update content every X seconds using ajax

how to update some web page section or a block content on a page every x seconds. Some real life examples of this functionality are Twitter search results that come out when there are new tweets with search keyword or bit.ly real time link tracking that updates it’s charts every 5 seconds. t is clear without saying that we are going to update our page content using AJAX and of course we love AJAX in jQuery flavor. So key to this functionality is JavaScript's built-in setInterval() function. It lets you to run some javascript function every X seconds. For example, the following code would pop alert box every five seconds: setInterval( "alert('Hello')", 5000 ); Now consider we want to update shouts in our shoutbox every 10 seconds. function updateShouts(){ // Assuming we have #shoutbox $('#shoutbox').load('latestShouts.php'); } setInterval( "updateShouts()", 10000 ); The code above will run every 10 seconds (10,000 ms) and...

Ajax Frameworks

The best technology to build dynamic web pages is Ajax. JavaScript code embedded into the HTML page is used to send requests to the server. At the server side, some processing is required to handle them, find the info or store the data. To do that, we need for a specialized framework. The framework has always a JavaScript part, and sometimes a server side part in another scripting language. A lot of them exist in various programming languages, in all environments around, but we retain here only the most widely used. Summary Why a framework? JavaScript libraries PHP frameworks Java frameworks .NET frameworks ColdFusion frameworks Ajax and XUL Resources Why a framework? Actually, this framework is the Ajax engine described by J. J. Garrett and intended to suppress waiting for the user when accessing the server. The framework provides classical, cross-browser functions to use the XMLHttpRequest object. But a framework may goes beyond that, and allow to build "r...