herbal tea garden

just another regularban.info web blog

MEMBERS:

The Beginners Guide to PHP

What Is PHP?

The full form of PHP is Hypertext PreProcessor and is a server-side scripting language. The PHP code can be combined with regular HTML tags and parsed on the server. The creator of PHP, Rasmus Lerdorf first displayed the language in the form of a Perl script . In 1997 it was adapted by Andi Gutmans and Zeev Suraski to use a C-written compiler. They completely reconstructed the original PHP into the web language that we know and use today.

Uses of PHP

It is used in the creation of dynamic web pages. Web developers like it because of its fast parsing and flexibility and versatility. PHP is a popular tool for managing a form's data after it is submitted and comes built in with many different interfaces and API's. It has database capability built into the language, the most common database being MySQL. Typically the PHP can connect to any SQL enabled database.

The Syntax of PHP is similar in structure to Perl and C where curly braces { } define blocks of code and semi-colons specify the end of a statement PHP is as easy to learn as Perl. It maintains all the traditional loops, if/else, and subroutines that are expected in a programming language. One difference between the two is that the code'?' is embedded in with the HTML; you could however, use a separate file. The PHP code is different from HTML code by use of the opening and closing tags. When it finds a PHP file, it tells the server to scan through for these tags, and execute the code in between them. The server recognizes a PHP enabled file by its extension, .php. These are essentially HTML files with PHP codes in them.

Getting Started

To start PHP requires a server with PHP installed and a simple ASCII text editor such as Notepad or VI, eMacs, Kate, etc. for a UNIX/Linux machine.

What are the problems faced by PHP?

It is case sensitive. For example if you name a variable $MyVar, you cannot call it as $myvar or $mYvAr. In case you forget to close your curly brackets, then it helps to indent lines inside the curly braces so that any missing braces can be spotted easily.

Mark Wallenheimo write articles for a web hosting guide when he is not actively following the hosting industry. He is a LAMP (Linux, Apache, MySQL and PHP) expert and he knows pretty much everything about linux web hosting and related topics.

 


301 Redirects - When and How to Use Them

Just what is a 301 Redirect?

There seems to be a lot of confusion as to what to do when you move, delete, or want to redirect incoming web traffic from an 'old' web page to a 'new' web page. A 301 redirect is the most efficient method for web page redirection from an old web page to a new web page location. There is also some confusion as to how to handle the complete move or redirection from one web domain to another web domain. According to Google, "If you need to change the URL of a page as it is shown in search engine results, we recommended that you use a server-side 301 redirect instead."

How to Set Up a 301 Redirect

Depending on your web environment, there are several methods to set up a 301 redirect. A 301 redirect is not that hard to implement and it should preserve your search engine rankings for that particular page or web domain.

.htaccess 301 Redirection

The .htaccess file needs to be placed in the root directory of your old website. In this example, we are redirecting incoming web traffic from an old domain to a new domain.

Options +FollowSymLinks

RewriteEngine on

RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]

The .htaccess file is the most common method used for 301 web site redirection.

PHP 301 Redirection

You would place this code in a file at the old location.

Header( "HTTP/1.1 301 Moved Permanently" );

Header( "Location: http://www.new_location.com" );?>

Of course with any code, you will want to test this.

IIS 301 Redirection

  • In Internet Services Manager, you need to right click on the file or folder you wish to redirect
  • Select the radio button titled "a redirection to a URL".
  • Enter the redirection web page
  • Check "The exact URL entered above" and the "A permanent redirection for this resource"
  • Click on 'Apply'

That is all there is to it.

There are other methods in addition to set up a 301 redirection which include coding for ASP, ASP.NET, Java, CGI, Cold Fusion and Ruby on Rails. The above are the most common that I've encountered. When set up correctly, a 301 redirect will preserve your search engine rankings when it is necessary to move files around or switch, or consolidate, domain names.

Jason Perry

Two great SEO tools which can help track the success of your web site are Web Position Gold 4 and Hits Link. Both which you can try for free.

 


Simple SEO Web Site Development Tips

So, you've bought your domain, got some hosting. Now what? You need to make sure that your web site is as friendly as possible to the search engines so that they send you some traffic. This process is called "search engine optimization" or SEO for short. It is probably the most important - and most neglected - part of web site development.

Here are some tips to help your SEO web site development.

1. Don't use frames

Frames may help you to control the layout of your site but they are a nightmare as far as the search engine robots are concerned and will make it difficult for your site to be crawled by the search engine spiders.

2. Make sure there's text on your pages

This even goes for the page featuring that expensive Flash movie that you're currently forcing visitors to your site to watch (or more likely press the "skip intro" link). Search engines don't know what's written on images or animations. They can only read text (the images search is their best guess based on the text on the page and the video search is based on the description of the video). So make sure they have text to read!

3. Separate style and content

This means using CSS as much as possible to control the layout of your pages. That way the spider can read more of your content if all the "this is how it should look" stuff is self contained in its own CSS file. The biggest snag with this is that CSS needs to be really well written if it is to look nice at different screen sizes, on different browsers and with varying amount of text on the page. Test at least in Internet Explorer and Firefox and play around with the width of the browser to see how well or badly your site copes.

4. Use a title tag

HTML design programs are good at putting in really generic titles such as "Page 1" or "Home Page" but they're almost certainly not what you want the search engines to think your site is about. Change the title to something meaningful. If possible make your title catchy and make sure it's short enough to be completely displayed when the search engine results are shown. This is basic SEO but you'd be amazed how many people don't do it.

5. Put in a meta description tag

Despite what you may read, the description tag is useful. It isn't often taken into account when Google or whoever decide which results to show, which is why some people say it isn't important. But it's normally used as the extract that's shown below the blue clickable link to your site. So if it says "XYZ home page constructed with Dreamweaver" instead of something interesting, that's what will likely show up below your title. And if it's blank, you're giving the search engines free reign to put whatever they want there.

6. Keep it simple

Spiders like simple. Despite all the advances in the internet, they're fairly dumb and the easier you make it for them to understand what your site is about, the more they will reward you.

Get more help on SEO web site development and do your best to make sure that your website gets the search engine results it deserves at http://www.squidoo.com/seowebsite

 


Pages 
* About

Archives
    * February 2008
    * January 2008

Categories:
* Uncategorized

Last Updated:

regularban.info is proudly powered by WordPress MU running on  regularban.info.
Create a new blog and join in the fun!
Entries (RSS) and Comments (RSS).