Rumor has it that a PHP+FastCGI installation provides a significant performance boost compared to a regular PHP+CGI installation. Some claim that it is even better than a PHP+ISAPI installation as it allows PHP to run just the way it is supposed to be without the inherent performance penalty associated with CGI. However the installation process turned out to be too much time consuming. I have therefore decided to document the process for those who have yet to install PHP.
November 21, 2009
October 24, 2009
Box with Round Corners Using CSS and Images - Part 2
This is another technique for creating round corners using CSS and images. This technique uses nine nested DIVs and images that are positioned and tiled using CSS background-position and background-repeat properties. It does not use any absolute positioning, margin positioning or hacks. As usual, I will first outline the features and limitations of the technique:
Pros
- Clean and tidy, table-less HTML markup
- Hack-less CSS
- Fluid width layout, adaptable to fixed width layouts as well
- No JavaScript required
- Known to work in most standards compliant browsers
- CSS markup is independent of the images size
- Can actually be used to create CSS fancy borders and frames (see examples below)
Cons
- Requires nine images, nine is too many!
- Requires nine nested DIVs, harder to manage
- Transparent images do not work well
- May not work all that well in IE7 and earlier versions
October 17, 2009
VBScript Ceil and Floor Functions
VBScript does not have native Ceiling and Floor functions. In order to use these function in your financial or mathematical applications, you will have to write your own VBScript implementation. By definition:
The ceiling and floor functions map a real number to the next largest or next smallest integer. More precisely, ceiling(x) is the smallest integer not less than x and floor(x) is the largest integer not greater than x.
So here is the VBScript implementation of these two functions:
October 12, 2009
YouTube JavaScript Player with Playlist
I have received appreciable feedback on my previous articles about embedding single and multiple YouTube videos in webpages. Based on that, I have created another example for embedding multiple YouTube videos with some enhancements:
- JavaScript driven playlist
- The video playlist is easier to configure and handle
- Next video is played automatically when current video ends
- Next video is played automatically if current video fails to play
October 6, 2009
PHP Rounded Corner Graphics Generator Script
The following PHP code sample uses GD library functions to dynamically generate rounded corner graphics. This PHP script allows you to specify corner radius, corner color and background color and generates the graphics in GIF format. Use this script to dynamically generate rounded corners that blend nicely into your HTML/CSS design.
August 18, 2009
Selecting Random Records from a Table
How do you go about selecting a set of N random records from a database? You can always write code for this purpose but that code will be complicated, long and slow-performer. You can instead write a query and let the database handle all the logic for you.
July 26, 2009
Adding Street View Support to Google Maps
Google Maps API version 2.104 introduces new classes that allow you to integrate Google Street View into your Google Maps. Google Street View provides 360° horizontal and 290° vertical panoramic views for various streets around the world.
The following demo shows how you can use the Google Maps API to integrate a Street View Panorama along with your Google Map. This demo uses the following classes from the Google Maps API:
- GMap2
- GStreetviewClient
- GStreetviewPanorama
July 23, 2009
How to Get Feeds For Specific Labels in Blogger
Blogger generates feeds for various items on your blog including posts and comments. Not many people know that these feeds can accept certain filters. The labels filter is one of them.
You might want to publish feeds for specific labels for various purposes. As an example, Aspin.com allows coders to submit RSS file of asp related resources into their database. You can label ASP specific posts from your blog as "asp" and publish its feed. You can label php related posts as "php" and publish its RSS to another resource. You may also want to publish specific feeds for targeted audience. Labels are the suitable method to group your posts by topic. These topics can then have their individual feeds. Your visitors can subscribe to feeds of their choice. All you have to do is to publish appropriate feed URLs on a suitable location.
Here is how you can get post feeds for specific labels.
July 14, 2009
Export MySQL Data to CSV Using PHP
15 minutes into writing this article, I realized that PHP 5.1 now includes the fputcsv function that was missing from earlier versions of PHP. It formats a line (passed as a fields array) as CSV and write it (terminated by a newline) to the specified file handle. However, it is not properly documented what exactly is the "newline" character; is it CR, LF or CRLF.
I have a habit of re-inventing the wheel, so I've put together a substitute for this function that echoes the CSV data instead of writing to a file and (tries to) closely follow the recommendations described in RFC 4180.
July 9, 2009
Export Recordset Data to CSV Using ASP/VBScript
The CSV (Comma-Separated Values) file format is a text file format in which you can store tabular data, such as data from a database table. This format is can be read by various spread sheet programs such as Microsoft Excel and OpenOffice.org Calc. This format is not suitable for storing binary data.
The following ASP/VBScript code sample allows you to export data from a database table to a CSV file. The code accesses the table through an ADODB Recordset object, formats the data into the CSV format and sends the data to the browser along with appropriate response headers. This code should be saved as an ASP script on a webserver. You should see an "Open/Save As..." dialog when you access the script through a web browser.
Labels
- about (1)
- asp (6)
- asp.net (1)
- blogger (2)
- css (2)
- fastcgi (1)
- file management (2)
- filesystemobject (1)
- functions (6)
- gd library (6)
- google maps (3)
- html (5)
- iis (1)
- image manipulation (7)
- installation (1)
- javascript (6)
- mysql (2)
- php (9)
- resources (1)
- seo (1)
- sql (1)
- sql server (1)
- tips (1)
- vbscript (5)
- whats hot (8)
- youtube (3)
About me
You can freely use the code examples in your work || You cannot re-publish the articles unless permitted under these terms and conditions || Privacy

