Archive for June, 2008
Monday, June 30th, 2008
Client/Server Request/Response
HTTP is a simple client/server protocol with stateless request/response sequences.
The Client HTTP Request
7 possible HTTP 1.1 request types: GET, PUT, POST, DELETE, HEAD, OPTIONS and TRACE.
Any number of HTTP headers can accompany a request.
GET /filename.php HTTP/1.0
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*
Accept-Charset: iso-8859-1,*,utf-8
Accept-Encoding: gzip
Accept-Language: en
Connection: Keep-Alive
Host: localhost
User-Agent: Mozilla/4.77 [en] (X11; U; Linux 2.4.5-pre4 i686; Nav)
The Server HTTP Response
HTTP/1.1 200 OK
Date: Mon, 21 May 2001 17:01:51 GMT
Server: Apache/1.3.20-dev (Unix) PHP/4.0.7-dev
Last-Modified: Fri, 26 Jan 2001 06:08:38 GMT
ETag: “503d3-50-3a711466″
Accept-Ranges: bytes
Content-Length: 80
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: text/html
Tags: Client, Connection, Delete, get, HEAD, HTTP, Image, Linux, localhost, Options, PHP, post, PUT, REQUEST, response, server, Text, Trace
Posted in PHP | No Comments »
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’,”);
}
?>
Tags: clocks, cookie, Expiry, explode, PHP, problem, SetCookie, solution, timeout
Posted in PHP | No Comments »
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”) ?>
Tags: Adding, compiled, cool, extension, flags, FTP, functions, PHP, phpinfo, problem, provider, Script, server, service, solution
Posted in PHP | No Comments »
Monday, June 30th, 2008
$today = getdate();
$month = $today['month'];
$mday = $today['mday'];
$year = $today['year'];
Tags: date, getdate, PHP, Today
Posted in PHP | No Comments »
Monday, June 30th, 2008
if (!($HTTPS == “on”)) {
header (”Location: https://$SERVER_NAME$php_SELF”);
exit;
}
Tags: Connection, Force, HTTP, HTTPS, location, PHP, secure
Posted in PHP | No Comments »
Monday, June 30th, 2008
It’s important to make sure that the web site loads as quickly as possible and that people can easily access all the pages. Waiting time should not exceed 30 seconds and links to other pages should be easily accessible. .
Tags: 30 seconds, Accessible, easily, load time, pages, people, SEO, Waiting, web site
Posted in SEO | No Comments »
Monday, June 30th, 2008
Before rushing off and registering your domain make sure it has the appropriate meta and title tags and that the web site has been optimised.
Tags: appropriate, Domain, optimised, Registering, SEO, slowly, Start, Tags, web site
Posted in SEO, google | No Comments »
Monday, June 30th, 2008
Choosing the correct domain name for a business is vital to its success on the Internet. If your business is called “Intoweb Design” and your core product is “web design”, the domain name “intoweb.co.za” could work. However a better domain name would be the core business product, “blog.tryangled.com”. The reason being search engines read keyword rich domains and rank the domain higher if it contains a main keyword.
Tags: blog, blog.tryangled.com, business, correct, Domain, internet, Intoweb Design, keyword, names, product, SEO, success, tryangled
Posted in SEO, google | No Comments »
Monday, June 30th, 2008
A link campaign is another way to increase your site ranking. One of the things a that a search engine calculates is how many sites in their database are linked to the site that is being optimized. Keep in mind that even though the quantity of sites linked to the site being optimized is important, the quality is probably more important.
If the sites that are linked to the site being optimized are banned by search engines or have negative content, they can actually harm your ranking severely. A good rule of thumb is to avoid controvesial sites such as adult links, gambling, and prescription drugs (unless your site is related), and or sites that are notorious for spamming.
When deciding whether or not to trade links with a particular site, try to find sites that have information relevant to yours. Considerably less “weight” in relevance is given to inbound links from sites that are not related to your site. So, in short, links from quality sites are a must.
Finding quality sites is tedious and risky. Everything from finding high PR sites to getting spam complaints makes this an error-prone task. But, it is necessary, so we scavenged the Internet for the solution.
Tags: Campaigns, considerably, gambling, Inbound, internet, Link, quality, Ranking, SEO, sites, task, weight
Posted in SEO, google | 1 Comment »
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.
Tags: building, google, optimzed, searching, Sitemap, solution, Using, visitors, wonderful
Posted in SEO, google | No Comments »