Posts Tagged ‘solution’

Php:Cookie Expiry

Monday, June 30th, 2008

Problem
Short expiry cookies depend on users having their system clocks set correctly.

Solution
Don’t depend on the users having their clocks set right. Embed the timeout based on your server’s
clock in the cookie.

<?php
$value = time()+3600 . ‘:’ . $variable;
SetCookie(’Cookie_Name’,$value);
?>
Then when you receive the cookie, decode it and determine if it is still valid.

<?php
list($ts,$variable) = explode(’:',$Cookie_Name,2);
if($ts < time()) {

} else {
SetCookie(’Cookie_Name’,”);
}
?>

Php:Adding an extension

Monday, June 30th, 2008

Problem

You need PHP’s built-in ftp functions for the ultra-cool script you are writing, but your service
provider does not have PHP compiled with the –enable-ftp option.

Solution

If you have a shell account on a system with the same operating system as your web server, grab the
PHP source tarball and build using:

–with-apxs –enable-ftp=shared
You can check which flags your provider used by putting a phpinfo() call in a script on your server.

<?phpinfo()?>
Once compiled, you will find a “modules/ftp.so” file which you can copy to your web server and
enable either by putting:

extension=ftp.so
in your php.ini file or by adding this to the top of your script:

<?php dl(”ftp.so”) ?>

Building and using a Sitemap

Monday, June 30th, 2008

The purpose of a sitemap is to enable search engines to index all the pages on a site being optimzed. Some search engines like Google recommend that you include a sitemap to speed up the indexing process reduce the risk of pages being skipped.

A sitemap can help more pages be listed, because not all search engines will go more than 2-3 link levels deep.

A secondary, but useful purpose of a sitemap is to assist visitors in finding their way around the site. Building a sitemap is a tedious chore and many sitemaps are neglected and go out-of-date as a result. So, after many hours of intense searching; we have found a wonderful solution.

Web Hosting Guide

Thursday, June 26th, 2008

Looking for and buying a reliable web hosting solution is an imperative decision. Whether you are doing online business, providing important information or sharing views online on a common interest, you need a reliable web hosting service that will allow online visitors to browse through your site effortlessly. It is only powerful web hosting that allows your website to be downloaded, browsed and updated in minimal time.

Trying to identify a web host can be a very daunting task especially when there are so many available nowadays and all of them promise one thing or another. Hence, it is crucial that before you jump in, you do your own homework or research for selecting the most appropriate web hosting company for your website.

With the changing trend of technology, web hosts are also changing. Most of them provide various services in addition to their basic ones. Say if you are running an e-commerce website, then of course you need high end security and a medium through which you can manage your web content efficiently. There are many tools that facilitate this, however if your web hosting service is not reliable then you can miss out on serious revenues and prospective clients.

Once you have determined and identified what web hosting services you require for your online business, it is then time to enlist certain web hosting features and options you must consider. You can find below some of the most important aspects of web hosting:

Disk space and bandwidth

You should know how much space your website would need and approximate data it will generate. When we talk about disk space, well, it’s actually the amount of storage assigned to you by the web hosting provider. The bandwidth is the amount of traffic that is allowed to access and leave your website. In case your website has a lot of graphics then you would require higher storage area and greater bandwidth.

Programming tools and the OS

You need to be sure that your website is uploaded through secure servers using the latest Operating System. Most web hosts run on a UNIX based operating system, usually Linux or BSD. For the running of various web applications you would require ASP, .NET, MS SQL, SBS and for these you need a Window based host.

Pricing Aspect

You need to compare pricing before you finalize a web hosting service. Some may provide you better services but at low pricing. It’s not always true that the best hosting services are always the most expensive. Do your research and then finalize.

Support, Security, Guaranteed uptime and Backups

Security and backups are two very important aspects that you need to consider. You should always choose a web hosting service with reliable telephone support. Some also offer 24/7 support through local or toll-free numbers. In case you are running an ecommerce website then security is one aspect that you just cannot discard. Your web hosting service provider should be such that they can monitor things round the clock and ensure no unwanted intruder can hack your site. After all it’s your website and it is really worth looking into this aspect of web hosting.

Launch Without Comments (and Add Them Later)

Thursday, June 19th, 2008

There’s something sad about a blog with 0 comments on every post. It feels dead, empty and unpopular. Luckily, there’s an easy solution - don’t offer the ability to post comments on the blog and no one will know that you only get 20 uniques a day. Once you’re upwards of 100 RSS subscribers and/or 750 unique visitors per day, you can open up the comments and see light activity. Comments are often how tech-savvy new visitors judge the popularity of a site (and thus, its worth), so play to your strengths and keep your obscurity private.

Choose the Right Blog Software (or Custom Build)

Thursday, June 19th, 2008

The right blog CMS makes a big difference. If you want to set yourself apart, I recommend creating a custom blog solution - one that can be completely customized to your users. In most cases, WordPress, Blogger, MovableType or Typepad will suffice, but building from scratch allows you to be very creative with functionality and formatting. The best CMS is something that’s easy for the writer(s) to use and brings together the features that allow the blog to flourish. Think about how you want comments, archiving, sub-pages, categorization, multiple feeds and user accounts to operate in order to narrow down your choices. OpenSourceCMS is a very good tool to help you select a software if you go that route.