27 Feb 2013

SYNTAX -- php tags

Where to place PHP code ?
First open notepad and Copy below images code in notepad or whatever your PHP-editor and save as abc.php (You can change file name but not extension) in your newproject folder (You can change the path but it should be in htdocs folder).
eg. c:\xampp\htdocs\newproject\abc.php

When PHP parses a file, it looks for opening and closing tags, which tell PHP to start and stop interpreting the code between them.

1.1st type is like this in below image.


2.Alternately you can choose to have many PHP blocks exactly located in the HTML Head or Body section of the document where that certain data would display. which is wrote in below image.


3. You can also write like below code.

26 Feb 2013

How to setup environment for PHP ?
AND
How to run PHP file ?

1. Download XAMPP from HERE .

2. Install it in your system. for more info. how to install Click Here

3. After installation reboot your system.

4. Open XAMPP control panel and start TOMCAT , APACHE , MYSQL.


5. To check that XAMPP is working or not Open your web browser and type localhost in address bar and enter.

if your page is not look like upper image that means there is some problem with your XAMPP.

6. C:\xampp\htdocs\ is the root of your web server. This is the place of our webpages.

7. Then for starting new project Go to the C:\xampp\htdocs\newproject or whatever your folder name you want.


8. For opening your project open the web browser and type localhost/newprject/index.php in address bar.

NOTE:here i already created a php page in C:\xampp\htdocs\newproject\ with name of index.php

9. We will see the PHP code in next post.

25 Feb 2013

Introduction


What is PHP?
PHP is an acronym for Hypertext Preprocessor. It is a dynamic server side scripting language that allows an application developer to create very simple to very complex mechanisms for the web.


Why Learn PHP?
1. Relatively easy to learn and understand.
2. Processes data fast and dynamically.
3. Most dynamic web applications being made today have a PHP core (brain).
4. Free Open Source Technology.
5. Processes online forms and sends emails.
6. Create files and directory folders out of thin air.
7. PHP can run on Linux as well as Windows server.
8. Its Object Oriented Language.
9. Huge Free online resource databases for classes and functions.
10. More than 700 Built-In functions.