Tuesday, 5 March 2013

Php


History of PHP

PHP
Description: PHP
PHP: Hypertext Preprocessor
Appeared in
1995; 18 years ago[1]
Designed by
5.4.12 (February 21, 2013; 12 days ago)
Influenced by
PerlCC++JavaTcl[1]
Implementation language
C
Common extensions
.php
Older, now uncommon extensions
.phtml, .php4 .php3, .php5, .phps, .php6-beta.
·         www.php.net

·         Description: http://upload.wikimedia.org/wikipedia/commons/thumb/d/df/Wikibooks-logo-en-noslogan.svg/16px-Wikibooks-logo-en-noslogan.svg.png PHP Programming at Wikibooks
PHP is an open-source server-side scripting language designed for Web development to produce dynamic Web pages. It is one of the first developed server-side scripting languages to be embedded into an HTML source document rather than calling an external file to process data. The code is interpreted by a Web server with a PHP processor module which generates the resulting Web page. It has also evolved to include a command-line interface capability and can be used in standalonegraphical applications.[2] PHP can be deployed on most Web servers and also as a standalone shell on almost every operating system and platform, free of charge.[3]PHP was a competitor to Microsoft's Active Server Pages(ASP) server-side script engine[4] and similar languages, but gradually received better acceptance and is now installed on more than 20 million Web sites and 1 millionWeb servers.[5]
PHP was originally created by Rasmus Lerdorf in 1995. The main implementation of PHP is now produced by The PHP Group and serves as the formal reference to the PHP language.[6] PHP is free software released under the PHP License, which is incompatible with the GNU General Public License (GPL) due to restrictions on the usage of the term PHP.[7]
While PHP originally stood for Personal Home Page[8], it is now said to stand for PHP: Hypertext Preprocessor, arecursive acronym.[9]

The LAMP architecture has become popular in the Web industry as a way of deploying Web applications. PHP is commonly used as the P in this bundle alongside Linux, Apache and MySQL, although the P may also refer to Python, Perl, or some mix of the three. Similar packages are also available for Windows and OS X, then called WAMP and MAMP, with the first letter standing for the respective operating system. Although both PHP and Apache are provided as part of the Mac OS X base install, users of these packages seek a simpler installation mechanism that can be more easily kept up to date.

PHP Introduction

PHP code is executed on the server.

What You Should Already Know

Before you continue you should have a basic understanding of the following:
  • HTML
  • JavaScript
If you want to study these subjects first, find the tutorials on our Home page.

What is PHP?

  • PHP stands for PHP: Hypertext Preprocessor
  • PHP is a widely-used, open source scripting language
  • PHP scripts are executed on the server
  • PHP is free to download and use
Description: lamp
PHP is simple for beginners.

PHP also offers many advanced features for professional programmers.


What is a PHP File?

  • PHP files can contain text, HTML, JavaScript code, and PHP code
  • PHP code are executed on the server, and the result is returned to the browser as plain HTML
  • PHP files have a default file extension of ".php"

What Can PHP Do?

  • PHP can generate dynamic page content
  • PHP can create, open, read, write, and close files on the server
  • PHP can collect form data
  • PHP can send and receive cookies
  • PHP can add, delete, modify data in your database
  • PHP can restrict users to access some pages on your website
  • PHP can encrypt data
With PHP you are not limited to output HTML. You can output images, PDF files, and even Flash movies. You can also output any text, such as XHTML and XML.

Why PHP?

  • PHP runs on different platforms (Windows, Linux, Unix, Mac OS X, etc.)
  • PHP is compatible with almost all servers used today (Apache, IIS, etc.)
  • PHP has support for a wide range of databases
  • PHP is free. Download it from the official PHP resource: www.php.net
  • PHP is easy to learn and runs efficiently on the server side

 

 

What is XAMPP / WAMP / MAMP

XAMPP/WAMP/MAMP – Single Package Consisting of Apache,Mysql,PHP In order for a web application to be Complete we need a database platform,A Server to execute server side Scripts and to store our files.

Description: https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOD67oedffn1B07Lw5aPeZDpKHNrPOGJOmJV9xOrdjTJdRXqEa_GEw7GPi4U3osWpfz7YHqYBFKbEfN4gPSLYm2qtOv1X3iOFvMYraICAUN89M_E4qhwj8M4J5hMdUN3Qr5RQ0MJ98h_A/s200/amp.jpg

Instead of downloading this packages Separately and installing them individually these are available in a Single Package.
Point to Mention here is they are available free of Cost.
This can be Downloaded Separately from
Apache: http://apache-http-server.en.softonic.com/
Mysql: http://www.mysql.com/downloads/



1.      WAMP
o    WAMP – Windows Apache MySql Php
o    Wamp is for windows which includes the the Apache server Mysql and Php that for optimised for the Microsoft Windows OS
o    Download link for WAMP: http://sourceforge.net/projects/wampserver/files/WampServer%202/WampServer%202.2/wampserver2.2c-x32.exe/download
Description: https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgX7pvPHVAGnuokCw6JznG4YMvgzSETCiQMrgzpGrosO30RaXIRpJWj7LEQq1S8ADAmRr40Jc5I6cWDW3UCkqII-6-9qpNAhIeIkoyPQVUUS7mclymwPqZbWKsjNVa2dtYgP7WLZwdGw0E/s1600/wamp.png

     2. MAMP
o    MAMP -Mac Apache MySql Php
o    Mamp is for Mac  which includes the the Apache server Mysql and Php that for optimised for the Macintosh OS
o    Download link for MAMP:  http://www.mamp.info/en/downloads/index.html
Description: https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoGNzg5zqASREW_F8WPFPyzgQTlDVcdhb2zfE_QFp65vFiZEFVgDpMnYv198nc4Zi_vF75UH0_-vfz9gXoI-ZK8Qr13hSdtSRqNNzdwaOy-eIORniOpAfVEbSzy_GKadEKMEo5Zmz7MEA/s1600/MAMP-PRO-Logo.gif
     3.XAMPP


o    XAMPP – X(Cross Platform) MySQl PHP Perl
o    XAMPP  is a cross platform package which runs on all Os such as Mac,Windows,Solaris etc,it is not built for a particular platform and its size is larger than the other two.
o    Additionally it also runs the Perl Scripts which is a older Server Side Scripting Language
o    Download link: http://xampp.en.softonic.com/download




Description: https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnbMQnf87oEi7BZvwm3f2upXJcbVyA474roGDkfgfG5yjcoIUY8RCF3SG5_XDFlX-kz9tonOSPlS16yEhCRzCP1bd98cBrRFFB7sAqJMxhfQG0-E5t7PQWW2xgCVXYVJS9zdN4FVPaeuo/s200/406469_3391808363464_1517293645_33052663_261175668_n.jpg
Thank u for reading this  Article hope it was useful !




Installing and Testing Wampserver

Hopefully, you have now downloaded and installed Wampserver. This will give you a server on your own PC (Windows users), somewhere you can test your scripts. If you haven't yet dowloaded the Wampserver software, you can download it here:
If the installation went well, you should have an new icon in the bottom right, where the clock is:
Description: http://www.homeandlearn.co.uk/php/images/wampserver_menu.gif
Click the icon to see the menu above.
From here, you can stop the server, exit it, view help files, and see the configuration pages.
Click on localhost, though, and you'll see this page appear: (Localhost just refers to the server running on your own computer. Another way to refer to your server is by using the IP address 127.0.0.1.)
Description: http://www.homeandlearn.co.uk/php/images/localhost.gif
Click the link under Tools that says phpinfo(). If all went well, you should be looking at the following page (The one below is a different php version, but don't worry about this - as long as you see something):
The info.php page (click to open in a new window 66K)
If you saw the above page, then congratulations! Your PHP server is up and running, and you can make a start scripting PHP pages.

Troubleshooting

If you don't see the info.php page, then you will need to refer to the wampserver forums. The page you need is here:
Hopefully, your question will already have been asked an answered. (Unfortunately, we can't answer questions about Wampserver, as it's not our software.)

Saving your PHP files

Whenever you create a new PHP page, you need to save it in your WWW directory. You can see where this is by clicking its item on the menu:
Description: http://www.homeandlearn.co.uk/php/images/wampserver_menu3.gif
When you click on www directory, you should see an explorer window appear. This one is from Windows Vista: (You'll probably have only two files, index and testmysql.)
Description: http://www.homeandlearn.co.uk/php/images/www_directory.gif
This www folder for Wampserver is usally at this location on your hard drive:
c:/wamp/www/
Bear this in mind when you click File > Save As to save your PHP scripts.

Launching your PHP scripts

Suppose you have created a php script called test1.php. To launch this script, you need to add the script name after localhost in your browser. So instead of this:
http://localhost/index.php
You would type this:
http://localhost/test1.php
You don't type the name of the wamp folder, however. This would be wrong, for example:
c:/wamp/www/test1.php
As too would this:
http://localhost/www/test1.php
Your server knows where the www folder is, so you don't have to type it out: just add the script name tolocalhost. Likewise, if you create a folder under www then you'd just type this:
http://localhost/folder_name/script_name.php

OK, we'll assume that everything is now up and running. If it's not, click "Move on to the Next Part" below, for some troubleshooting. If it is, click "Back to the PHP Contents Page".

No comments:

Post a Comment