What is PHP?
PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used, free, and efficient alternative to competitors such as Microsoft’s ASP.
- Serverside scripting language
- Used for web development
- Generate dynamic web pages
What you will need?
- Computer with PHP installed
- Text editing application
- A web browser
What would be helpful?
- Understanding of HTML
- Understanding of programming concept
- Understanding how web server works
Hypertext is text that links to other information. By clicking on a link in a hypertext document, a user can quickly jump to different content.
In computer science, a preprocessor is a program that processes its input data to produce output that is used as input to another program. The output is said to be a preprocessed form of the input data, which is often used by some subsequent programs like compilers.
Serverside Scripting Language
Those scripts were executed by the operating system, and the results were served back by the web server. Many modern web servers can directly execute on-line scripting languages such as ASP, JSP, Perl, PHP and Ruby either by the web server itself or via extension modules (e.g. mod_perl or mod_php) to the web server.
A Web server is a program that uses HTTP (Hypertext Transfer Protocol) to serve the files that form Webpages to users, in response to their requests, which are forwarded by their computers’ HTTP clients.
Web development broadly refers to the tasks associated with developing websites for hosting via intranet or Internet. The Web development process includes Webdesign, Web content development, client-side/server-side scripting and network security configuration, among other tasks.
A dynamic web page is a web page that displays different content each time it’s viewed. For example, the page may change with the time of day, the user that accesses the webpage, or the type of user interaction.
Common uses of PHP
- PHP performs system functions, i.e. from files on a system it can create, open, read, write, and close them.
- PHP can handle forms, i.e. gather data from files, save data to a file, through email you can send data, return data to the user.
- You add, delete, modify elements within your database through PHP.
- Access cookies variables and set cookies.
- Using PHP, you can restrict users to access some pages of your website.
- It can encrypt data.
Characteristics of PHP
Five important characteristics make PHP’s practical nature possible −
“Hello World” Script in PHP
To get a feel for PHP, first start with simple PHP scripts. Since “Hello, World!” is an essential example, first we will create a friendly little “Hello, World!” script.
As mentioned earlier, PHP is embedded in HTML. That means that in amongst your normal HTML (or XHTML if you’re cutting-edge) you’ll have PHP statements like this −
<html> <head> <title>Hello World</title> </head> <body> <?php echo "Hello, World!";?> </body> </html>
It will produce following result −