Monday, 6 April 2015

basic of php

Some Basic Information about PHP

  • PHP is an open-source server-side scripting language.You can create dynamic web pages with the PHP scripting language. A dynamic Web page interacts with the user, so that each user visiting the page sees customized information. PHP can also be used to create dynamic web pages that are generated from information accessed from a MySQL database. You can embed PHP commands within a standard HTML page.
  • PHP offers is connectivity to most of the common databases.it also offers integration with various external libraries.

Server-side scripting

  • Server-side scripting is a technique used in web development 
  • which involves employing scripts on a web server which produce a 
  • response customized for each user's (client's) request to the website.
  • The alternative is for the web server itself to deliver a static web page.
  • Scripts can be written in any of a number of server-side scripting languages.
  • Server-side scripting is distinguished from client-side scripting where embedded scripts,
  • such as JavaScript, are run client-side in a web browser, 
  • but both techniques are often used together.
  • Server-side scripting is often used to provide a customized interface for the user.



  • How to Save Your PHP Pages
              with .php extension

  • Example Simple HTML & PHP Page


Display Hello world



PHP - Variables

$variable_name = Value;


Example

Outputting a String


another example



PHP - Strings



PHP - String with Single Quotes



PHP - Operators


• Assignment Operators
• Arithmetic Operators
• Comparison Operators
• String Operators
• Combination Arithmetic & Assignment Operators

The Include Function



save this file as course.php

now you can call this file in other file also:- using below example:-


The If Else Statement



start programming


file save as index.html



file save as main.php



now run the index.html file and feed the input field


No comments:

Post a Comment