Web Development Blog

Web development tutorials, SEO articles and PHP script resources

Subscribe to this blog

Archive for the ‘Tutorials’ Category

Monday
Apr 14,2008

This is part 2 in our series on how to optimize your Wordpress blog for Google. In our earlier post we discussed how to avoid the duplicate content penalty when blogging with the Wordpress blogging software; today, we are going to share how to optimize your Wordpress blog for search engine friendliness especially for the Google search engine.

Interlinking your blog posts

Since your blog should be topically related anyway, you should have no problem referencing previous post from time to time in new blog postings. Also, it wouldn’t hurt to edit your older blog postings to include topically related links for new posts. Not only does this help to improve your internal linking structure, it can also help improve keyword relevancy for certain pages if you’re using keyword focused, or descriptive, anchor text for your internal URL’s.

Another approach to boost the link popularity and improve the visibility of your blogs internal pages is to offer a sitemap, one which will benefit users and work to help with search engine spidering. (more…)

Friday
Nov 16,2007

Setup a quick Yahoo Search page within a few minutes!

A few days ago the “old” Google web search API has stopped working for the web public. Not a big surprise after the release of the AJAX web search API. A customer of mine is using search results in his mini sites to give them a little more body. This is why I needed to look for some alternative. During the Zend PHP conference earlier this year, I got in touch with the Zend framework and learned that there is already a class to obtain results from the Yahoo search engine. The class has features to search the Yahoo API for web sites, image, news and the local search results.

Installing the library

I decided some time before to use the classes from the Zend framework for future projects because the classes are well written in PHP5. If you like to do the same you should install the lib on a central place on your web server to get access to the framework from all your websites. After uploading the files I added this row to .htaccess file for the website I’m working on:

php_value include_path ".:/home/mylocation_for_zend_framework/"

This way you’re able to access the classes without to think about the class paths. Of course you are free to add this include path to the php.ini file or to your apache configuration. (more…)

Thursday
Oct 11,2007

FTP hosting is often much cheaper than regular web hosting. The upload with an ftp client is for sure the most common way, but could be a problem for people behind a firewall or without enough rights (capabilities) to install a FTP client. For those a upload via a web form is the best solution.

Upload limitations by your web server

The default value for file uploads within PHP is 2MB, if you need to upload bigger files you need to change your PHP configuration or need to create a .htaccess file with this code to upload files of max. 16MB:

php_value upload_max_filesize 16M
php_value post_max_size 20M

The value for the post_max_size is larger than the value for the upload_max_size because we want to be able to upload more than just a file (also other data via text fields or text areas). The .htaccess file needs to be in the same directory than your upload script.

Using cURL for file transmissions

cURL is a great library for file transmissions via different types of protocols. The library supports the transport via POST, GET, FTP upload and much more. cURL is also able to authenticate on the target server or website.

In this tutorial we want to upload a file to some (password protected) remote FTP server via a web form. (more…)

Monday
Sep 24,2007

For a future project I needed these days some easy to use zip or gzip class to create a zip file from files / folders inside a specified directory. A short search on Google has lead me to the Create ZIP File PHP class from Rochak Chauhan. I tested two other scripts before and must say that this script works great for single files if you add them manually.

To compress a whole directory with an unknown number of files into one zip file I created some class extension to get this job done.
I used some directory functions (opendir, readdir) to get all the files from the specified directory. Inside each directory there are files and “real directories” and directory locations. We need only the real directories. We test each value with “is_file”, “is_dir” and we filter off the directory directions (”.” and “..”). After the “file” is identified, the files content is added to the “addFile” object and for other directories the method “get_file_from_folder” is called again. (more…)