Thursday, July 21, 2016

How to create simple PHP page?

What is PHP?
"PHP: Hypertext Preprocessor". PHP is a freeware scripting language. PHP is server side scripting language. It is powerful for making interactive, faster, and dynamic web pages. To create PHP one should know basic about HTML, CSS and JavaScript. A simple PHP example is given below. It is widely used and it compete with Microsoft’s ASP in market.

Why PHP?
Fast Load Time – PHP is much faster than ASP because it runs with its own memory space while ASP uses overhead server.
Less Expensive Software – Working with is almost because software like wordpress are open source and free to use while ASP is costly compare to PHP.
Database Flexibility – There are many DB that can be used with PHP most commonly used is My SQL. MySQL is also open source and free. Other DB like dBase, IBM DB2, Inter Base, Front Base, ODBC, Postgre SQL, SQLite, etc. are also supported.

How to use PHP?
Set Up PHP on Your Own PC
However, if your server does not support PHP, you must:
  • install a web server
  • install PHP
  • install a database, such as MySQL
The official PHP website (PHP.net) has installation instructions for PHP: http://php.net/manual/en/install.php

Example

<html>
<body>

<?php
echo "<h1>starting with PHP..!!!</h1>";
?>

</body>
</html>


  • A PHP script starts with   <?php   and ends with   ?>.
  • The default file extension for PHP files is ".php".
  • "echo" is a built in php function that help to output in our case text ” starting with PHP..!!! is printes

Output



Other interesting things to know?

CAPABLE
It can be used to design any type of website and can handle websites with a lot of traffic. Facebook, Twitter, Wikipedia and many other very widely visited websites are made from PHP.

EASY
It has a readable and easily understandable syntax. Its code is embedded in the HTML source code and it is based on C/C++. Therefore, it is very familiar and programmers are very comfortable coding with it.

PLATFORM INDEPENDENT
It can be run on all major operating systems like Linux, UNIX, Mac OS and Windows.

FASTER DEVELOPMENTS
It uses its own memory space and thus decreases the loading time and workload from the server. The processing speed is fast and web applications like Ecommerce, CRM, CMS and Forums are also developed faster by it.

SECURE
It has multiple layers of security to prevent threats and malicious attacks.

LARGE COMMUNITIES
It has a large community of developers who regular and timely updates tutorials, documentation, online help and FAQs.

PROVEN AND TRUSTED
It is being used since close to two decades now since its inception in 1995. It is trusted by thousands of websites and developers and the list is increasing day by day. It has also proven its capability and versatility by developing and maintaining some of the most highly visited and popular websites.

No comments: