Archive

Posts Tagged ‘Web Development’

Parse .html as PHP in XAMPP

July 30th, 2009

How can I configure Apache to treat .html files as PHP?

This is very common issue faced by almost every developer at some point, recently I had it on my XAMPP setup (version 1.7.1). Other concerning details are:

###### ApacheFriends XAMPP (Basispaket) version 1.7.1 ######

+ Apache 2.2.11
+ MySQL 5.1.33 (Community Server)
+ PHP 5.2.9 + PEAR (Support for PHP 4 has been discontinued)

Solution:

I simply changed following line:

<FilesMatch “\.php$|\.php5$|\.php4$|\.php3$|\.phtml$|\.phpt$”>

to

<FilesMatch “\.php$|\.php5$|\.php4$|\.php3$|\.phtml$|\.phpt$|\.html$“>

in httpd-xampp.conf

OR

change line 21

From
<FilesMatch “\.php$”>

To
<FilesMatch “\.php$|\.html$”>

and it worked great.

Post to Twitter Post to Plurk Plurk This Post Post to Yahoo Buzz Buzz This Post Post to Delicious Delicious Post to Digg Digg This Post Post to Ping.fm Ping This Post Post to Reddit Reddit This Post Post to StumbleUpon Stumble This Post

PHP , , , ,

Using curl with PHP Tutorial

February 3rd, 2009

Recently while developing a database backed php website, the client demanded to have all forms on one site say www.client-forms-website.com, and all the data to be submitted and stored on www.client-database-website.com.

Curl was the ultimate solution. curl is the client URL function library. PHP supports it through libcurl. To enable support for libcurl when installing PHP add –with-curl=[location of curl libraries] to the configure statement before compiling. The curl package must be installed prior to installing PHP. Most major functions required when connecting to remote web servers are included in curl, including POST and GET form posting, SSL support, HTTP authentication, session and cookie handling.

Leaving out all the fancy stuff, this is what I implemented:

On www.client-forms-website.com:

Created a file “receive-form-data.php” with following code.

<?php

// Move posted data into variables.

$firstName= @$_POST[firstName];
$surName= @$_POST[surName];
$email= @$_POST[email];

//The $curlPost variable is being used to store the POST data curl will use. When forming the $curlPost variable which will be used by curl_setopt later be sure to urlencode your data prior to passing it to curl_setopt.

$curlPost = “firstname=”.urlencode($firstName).”&surname=”. urlencode($surName).”&email=”. urlencode($email).”&submitted=true”;
$ch = curl_init();
//set the handle of the curl session to $ch
curl_setopt($ch, CURLOPT_URL, ‘http:// www.client-database-website.com/process-posted-data.php’); //set the URL of the page to pass data.
curl_setopt($ch, CURLOPT_HEADER, 0); //sets whether or not the server response header should be returned, 0 means no header.
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //by default curl will display the response straight to the browser as the script is executed. To counter this we enabled the CURLOPT_RETURNTRANSFER option.
curl_setopt($ch, CURLOPT_POST, 1); //tell curl to send the form response via the POST method.
curl_setopt($ch, CURLOPT_POSTFIELDS, $curlPost); //option used to store the POST data.
$data = curl_exec($ch); // $data stores data returned from the remote server.
curl_close($ch);

if ($data==1) header(“location: http:// www.client-forms-website.com /thankyou.html“);

else if ($data==0) header(“location: http:// www.client-forms-website.com /error.html“);

?>

On www.client- database -website.com:

Created a file “process-posted-data.php’” with following code.

<?php

$firstName= @$_POST[firstName]; $surName= @$_POST[surName]; $email= @$_POST[email];

/* Function/lines of code to Store Data go here.*/

If (success) echo 1;

else echo 0;

?>

This is working great. Have fun.

Post to Twitter Post to Plurk Plurk This Post Post to Yahoo Buzz Buzz This Post Post to Delicious Delicious Post to Digg Digg This Post Post to Ping.fm Ping This Post Post to Reddit Reddit This Post Post to StumbleUpon Stumble This Post

PHP , ,

My Favorite FireFox Add-ons

January 29th, 2009

I am a web developer and SEO professional, and use a variety of desktop and online tools to get the job done including Mozilla Firefox. It’s the premium web browser used by most of web professional, but very few comprehend that by installing some of the many free extensions/add-ons, they can get rid of most of the other applications they currently use. Below are my 9 favorite extensions for web:

FireFTP – is a free, secure, cross-platform FTP client for Mozilla Firefox that provides easy and intuitive access to FTP servers. You don’t need a separate program for FTP, very handy.

Professor X – lets you view web page’s header information without having to view source code. It displays the contents of the page’s header, including Meta, Script and Style content.

WHOIS Lookup 1.1 – View the WHOIS information for any page easily and quickly by clicking the button on the top-right of the browser.

IE View – If you frequently use Internet Explorer to test how your website renders on that browser,tThis add-on allows you to view the way any page would look if it were opened in IE, without the hassle of opening another browser.

WebDeveloper toolbar – This all-in-one toolbar provides you swift control over things like JavaScript display, form and CSS elements, screen resizing (so you know what your website looks like in smaller resolutions), HTML validation, and much more.

AdSense Preview – preview the Google AdSense ads that would appear on that page. This is incredibly useful if you are considering putting AdSense on a page and don’t want to go through the hassle of signing up for an account and putting the ads up just to see what type of ads will show.

Screen grab – It takes a screen shot of what you can see in the window, the entire page, just a selection, a particular frame and saves it as an image file. This saves a ton of time compared to the method I used to use – take a screenshot and open Adobe Photoshop to crop the image.

MeasureIt – You can use this to draw out a ruler to get the pixel width and height of any elements you see on a webpage. It’s very simple to use, and of course very helpful at times.

Gspace – This turns your Gmail Space (4.1 GB and growing) into an online drive, so you can use it to upload files from your hard drive and access them from every Internet enabled computer.

What are your favorite add-ons for web developing? Leave us a comment below.

Post to Twitter Post to Plurk Plurk This Post Post to Yahoo Buzz Buzz This Post Post to Delicious Delicious Post to Digg Digg This Post Post to Ping.fm Ping This Post Post to Reddit Reddit This Post Post to StumbleUpon Stumble This Post

Web Development , , ,

What makes a website successful?

January 27th, 2009

There are many significant aspects to take into consideration when building a website to generate leads (irrespective of the niche). These aspects will help determine how successful a website is at gaining organic search engine results, converting visitors to solid leads, and overall lead generation success.

High Quality Contents

To stand tall among the crowd, your lead generation website has to be convincing. If you can exhibit your expertise with high-quality content on topics that interest your website users, you can have them coming back again and again. Eventually you’ll earn trust of your users and this’ll lead to success, but remember key is “high-quality fresh content”.

A part from this, you can offer free tools and resources that have value will be highly appreciated. These typically include relevant free eBooks, blogs, and other resources that help your website visitors.

Ease of Use

Great content is a must. But if your visitors can’t easily find way to your information, tools and resources, then that great content will be wasted. Your website must be organized properly so that it is very easy to navigate and is not confusing to your visitor.

Proper website architecture will increase conversion ratings. A big part of architecture is where you place your calls to action. To optimize your conversion percentages to generate the highest possible number of visitors and leads, there should be a visible call to action on every important page of your website. Usually the top portion of your webpage is considered to be the best for the purpose.

Technical Aspects

Although it’s not a major issue these days, but still make sure that your website loads as quickly as possible (avoid excessive use of graphics and animations as much as possible, bottom line is try to keep it simple). Test it to fullest possible extent, your site should perform without any bugs or errors.

Search Engine Optimization

There are many other important stuff you can do to your website to optimize it to generate maximum leads. For example, you can put the keywords you are targeting into your header tags, page urls, as well as on the content of your website. With the proper search engine optimization, you will get higher rankings in the search engine which will bring you more traffic for the terms you are targeting. For more on this topic you may like to visit Learn And Apply SEO To Your Website.

All of the above mentioned points are crucial for cultivating a successful online presence. You can just have a site designed and start making money. You have to give proper time and thoughts to it. The idea is to create a professionally optimized, easy to navigate website that ultimately will generate leads and revenue for you.

Post to Twitter Post to Plurk Plurk This Post Post to Yahoo Buzz Buzz This Post Post to Delicious Delicious Post to Digg Digg This Post Post to Ping.fm Ping This Post Post to Reddit Reddit This Post Post to StumbleUpon Stumble This Post

Website Design , ,

Step by Step SEO For Beginners

January 4th, 2009

There could be shortcuts, but believe me if you seriously want to stay in the SEO game, learn it the proper way. The way to learn anything is to want to learn it, go at it, get it wrong, fix the problem, try again. However, guides like these, help and give you a head start, because you don’t have to waste time on compiling what actually needs to be learnt and in what order. Over the years I have gone through countless step-by-step guides while trying to understand search engine optimization. For starters, following is a compilation of the most useful steps towards learning SEO.

Learn how to make a basic website

Before getting into SEO techniques it’s vital to know the basics of web development. Follow the steps mentioned below to develop the necessary web development skills required to become a successful SEO:

Learn basics of HTML - Don’t step back, writing HTML is much easier than you think. If you are reading this and know how to use a web browser to load a website, you can code HTML. Try this excellent tutorial, just focus and follow.

Build a CSS driven website – All of the presentation and styles with CSS i.e. No Tables! Check this comprehensive tutorial.

Test your website in different browsers - Each browser interprets your website code in a slightly different manner, which means that it may appear differently to visitors using different browsers. While most people use Internet Explorer, a sizable portion of your users will use other browsers such as Firefox, Opera or Safari. Therefore it’s important to check your web design on different browsers to ensure all users view the webpage as it’s intended. Browsershots is a comprehensive service, offering multiple versions of browsers for various operating systems.

Choose your keywords - Getting the right keywords is everything, so be careful. You are just starting out, pick keywords that are less competitive. You might be wondering why am I choosing the keywords here (under the heading “Learn how to make a basic website “)? Well! all of the SEO game is played around the keywords. Selection of a proper domain name based on your chosen keyword plays a vital role, that’s why we are doing this step before registering a domain name.

So how do you know which keywords are good to go. This is a vast subject and needs a lots of articles dedicated solely to this section. But for the beginners, choose a keyword, say your business name, go to Google and search for yourself. If the result shows a small amount of low quality websites, use it as your keyword(s). If competition seems high (you see loads of high quality web sites) to rank for, try some variations.

Register a Domain Name & Find Suitable Hosting – This is again not as difficult as it sounds. There are tons of choices out there. I have good experience with Hostgator and WebSiteSource, you can use anyone of these. However, you are free to make your own decision, just make sure you shouldn’t be paying high and the domain name should be included for free as part of your hosting package. For your domain name, use your keywords from above. If your keywords are not available as a domain name, choose different keywords. (Although having similar keywords to your domain name makes SEO much easier.)

FTP/Upload your website files to your new hosting account - The are literally hundreds of FTP programs available on the web. I use FileZilla, the free FTP solution. FileZilla is open source software distributed free of charge under the terms of the GNU General Public License. You many also ask your hosting provider for instructions.

Add a sitemap - It is a page (or sometimes more than one page) that contains links to all of the pages on your website. Depending on the size of your website, you can simply create a page with links to all of these pages.

However, if your site is getting large you might want to automate the building of the page, there are many tools available on the internet to allow you to build a site map. A search on any of the major search engines will bring up plenty of choice. I use xml-sitemaps, because of it’s simplicity and feature rich nature.

Sign up for Google AnalyticsThis free tool will help you improve website ranking by tracking visitors to your website. Applying this to your website is very easy, detailed instructions are included by Google.

Search for your keywords in big search engines – Wait for 7 days and then check how your site is ranked/positioned in the major search engines (Google, Yahoo, and MSN). I generally use Search Engine Positioning Tool (saves lot of time). It is fine if your website doesn’t show up at this point, however, if it does come up (congrads), record how it ranks in a spreadsheet.

Wait couple of weeks for Google Analytics to gather data and let search engines find your website (if they are still searching for it ;-) )

Part Two: Learn & apply SEO to your website

Post to Twitter Post to Plurk Plurk This Post Post to Yahoo Buzz Buzz This Post Post to Delicious Delicious Post to Digg Digg This Post Post to Ping.fm Ping This Post Post to Reddit Reddit This Post Post to StumbleUpon Stumble This Post

SEO , ,

Twitter links powered by Tweet This v1.6.1, a WordPress plugin for Twitter.