The most simplest example of PHP

Example 1 – Hello World in PHP

Following a long tradition of introductory programming and scripting tutorials, our first example will print “Hello World” in the browser window.

<HTML>
<HEAD>
<TITLE> Hello World in PHP </TITLE>
</HEAD>
<BODY>
<?
// Hello world in PHP
 print("Hello World");
?>
</BODY>
</HTML>

The PHP statement:

<? print("Hello World"); ?>

displays the message “Hello World” in the browser window. As was mentioned earlier, PHP statements are embedded into HTML documents and they appear between <? and ?> symbols.

The PHP print function displays the value or string within parentheses in the browser window.

Several important things to note about PHP scripts:

  • PHP is case sensitive, print is different from PRINT
  • PHP statements appear between <? ?>
  • PHP statements end with a semi-colon
  • You can include comments in your PHP code by beginning the line or lines with // characters
  • Your PHP files should have a .php extension rather than a .html extension. If scripts have a .html extension the server will not know that they are PHP files and will not parse and execute the PHP commands.
  • Share/Bookmark
Tagged with:
 

What is PHP?

What is PHP?

From the PHP Web site (www.php.net):

“PHP is a server-side, cross-platform, HTML embedded scripting language.”

That’s a mouthful, but if we break the definition down into smaller pieces, it is easier to understand.

  • server-side: This means that PHP scripts execute on the Web server, not within the browser on your local machine.
  • cross-platform: Cross-platform means that PHP scripts can run on many different operating systems and Web servers. PHP is available for the two most popular Web server configurations (IIS running on Windows NT and Apache running on UNIX).
  • HTML embedded scripting language: This means that PHP statements and commands are actually embedded in your HTML documents. When the Web server sees the PHP statements in the Web page, the server executes the statements and sends the resulting output along with the rest of the HTML. PHP commands are parsed by the server much like Active Server Pages or Cold Fusion tags.
  • Share/Bookmark
Tagged with:
 

Why is my website not being Indexed by search engines?

I Love Google

I Love Google

SEO Help for your website

At one time or another, you may have manually submitted your website to search engines without success, and wondered why your websitewasn’t being indexed. And perhaps you even used a submission service, all to no avail. You are not alone. Many websites are also unable to be indexed. Fortunately, there are ways to correct your problem.

Below are some common factors which might delay or even prevent your site from being indexed by search engines, as well as suggestions on how to fix the problems.

Time Elapsed Since Submission

Patience Grasshopper. While we hear of services that promise to get a website indexed within 24 hours, the typical time for a website to get indexed is 1-8 weeks. If you need to get indexed more quickly, some search engines offer paid submission options. Maybe add an RSS feed, the Search Engines index those quite rapidly.

Already Indexed

You may be already indexed. Before fretting about being unable to find your website in a search engine, refer to that search engine’s documentation on the method to find a particular website. Additionally, beware of submitting your website to often. With some search engines,duplicate or excessive submissions can hurt ranking.

Reachable From Homepage

Search engines have been known to drop certain pages from their indexes that cannot be reached from the home page. For this reason, many websites include site maps (XML or HTML Format). However, if your site is small, a good navigation should suffice. (Note: Search engines generally index pages that are reachable within 1 to 2 links from the home page.)

Inbound Links

Many search engines refuse to index websites that do not have any links pointing to them from other sites. You can easily remedy this situationby submitting your website to directories, soliciting links from other similar sites, and by being active on discussion boards.

Frames

Frames have often been big problems for websites. Frequently, search engines are able to index the main content of the homepage, but not thenavigation, resulting in only one page of the site being indexed.

Free Web Hosting

Some search engines refuse to index or simply limit the number of pages that they will index from website residing on free web hosts. This ismost likely due to the poor quality of sites on these hosts as well as their frequent use by spammers.

To avoid being discriminated against, simply purchase your own domain name and opt for a respectable host. (For a domain name and basic hosting, you can expect to pay $90 – $150 per year, a small price to pay for a search-engine-friendly website.) If you can register your domain for more than 1 year, a good sign of stability.

Unfriendly Dynamic URLs

If your website is dynamic, many of your urls might contain question marks (?) and ampersands (&). Unfortunately, many search engines ignore these urls. As a result, if you want these pages to be indexed, you will need to create search engine friendly urls (most likely with.htaccess files) or generate static versions of each dynamic page.

JavaScript, AJAX, and Flash

Some content is non-indexable by search engines. This includes, but is not limited to JavaScript, AJAX, Flash, Java applets, audio or videofiles, or text included in images. Be sure that there is actual rich text content on your website or it may be ignored by search engines. This may change in the future, but for today, HTML files are the easiest to index.

Slow Loading Pages and Unreliable Web Hosts

Web pages that take a long time to load may negatively affect your site being indexed. For example, a web page might timeout before a searchengine can index the content. To avoid this problem, keep your pages small. Minimize whitespace, optimize images.

Similarly, a web host that is unreliable also makes it impossible for a search engine to have consistent access to your website. This could resultin pages not being indexed, or pages that are already indexed being dropped from their databases.

Search Engine Optimization or Spam?

If your SEO tactics are questionable, a search engine may penalize you for spamming. So be careful when optimizing your pages and do not excessively repeat keywords or use special techniques to serve different content to search engines and other content to visitors.

  • Share/Bookmark
Tagged with:
 
Positions by Seo-Watcher