Submitted by: Submitted by sanamrs
Views: 148
Words: 2397
Pages: 10
Category: Business and Industry
Date Submitted: 03/04/2013 04:12 AM
Learn Php
Php Intro.:
What is PHP?
* Known as Hypertext Preprocessor
* Server-side scripting language, like ASP
* Its scripts are executed on the server side.
* The databases which supports by php are (MySQL, Informix, Oracle, Sybase, Solid, PostgreSQL, Generic ODBC, etc.)
* This is also known as open source software
* The files which contains php code saved as .php extension.(for eg. If our file name is “siddharth” then I save it with .php extension “siddharth.php” )
* Php file also contains the html code. But always saved as the .php extension.
* We can import the php code in any HTML document any where it run success fully.
* But keep in mind that file will always saved as the .php extension if it contains even a little bit of php code.
PHP Install:
Follow the tutorial given on the link below and know how to install PHP5: http://www.php.net/manual/en/install.php
Download PHP:
Download link is here: http://www.php.net/downloads.php
Download MySQL Database
Download MySQL link is here: http://www.mysql.com/downloads/
Download Apache Server
Download Apache link is here: http://httpd.apache.org/download.cgi
PHP Syntax
A PHP code block of code we always starts with <?php and ends with ?>. A PHP code of block can be placed anywhere in the document. As I said earlier.
Example
<html>
<body>
<?php
echo "Dulcet Solutions";
?>
</body>
</html>
Note: echo is used to print something on screen as in c language we use print.
Now the Comments in PHP
In PHP, we use // to make a single-line comment or /* and */ to make a large comment block. We cannot declare a comment inside a comment.( for eg. /*first comment/*second comment*/ */ this is wrong )
<html>
<body>
<?php
//This is a single comment
/*
This is
a large comment
block
*/
?>
</body>
</html> |
Variables in PHP
All variables in PHP start with a $ sign symbol.
Declaration...