Variable in PHP

Posted by Unknown on 2:28 AM comments (0)


As we earlier saw in echo chapter that we echo " hello everybody" .We will need to use this sentence several times or even thousand times.Can we echo this sentence thousand time?,if do it will be hard working and folish work.To solve this problem we use Variable in php.

Variable syntax 

Example: $variablename="value";
Description
First of all we need to use symbol to identify that this line is variable.We use dollar sign ($)  first.Then we declare our variable name,where we want to save our values.We can keep different  data type as variable value such as string, integer,float,double.

Your First PHP Lesson

Posted by Unknown on 2:19 AM comments (0)


we already know the syntax of php,Now we will know how to add content into it,.So lets start
first of all we should to write php syntax.Then we use "echo" function without double quote.

Echo

echo means print or show something in browser .It works same as its meaning in English.Suppose if we want to show "Hello everybody" or word or sentence you like in php, we must  use echo.There have an alternative of echo that is print but it uses less.
<?php
echo "We can write here thousand of words or sentence and it will show in browser."
?>
Here i want to mention one thing that is string must be contained within double quotation mark ("  text here ").On the other-hand, Integer(0,1,2....9)and float (9.8) without double quotation mark.

What is the syntax of php?

Posted by Unknown on 2:15 AM comments (0)


In html we use <html> Content goes here </thml> syntax and if we coding insite of that html tag it consider that we using html tags.Like that in php we use <?php  Content goes here  ?>.
There have another option that is <? content goes here ?>.The symbol  " <?php or <?" means the start of php tag and symbol ?> means the end of php tag.Every thing insite them will consider php content.The first one is standard,although second one is grammatically right.we must saved our file adding extension .php after the file name.

Installing localhost server to run PHP

Posted by Unknown on 2:11 AM comments (0)



PHP is server side scripting language.So we need to install a server in our Personal Computer

Installing server to run php is very easy if you go step by steps with proper guideline.Here we want to demostrate steps .

One substantial thing we must do that is installing server if you are using standalone computer.we can not view php page in text editors browse or view option such as in Adobe dreamweaver we can view our page in browser just click view menu and select our preferred browser such as mozilla firefox or internet explorer and many more.

SO what we can do to view our php pages?

No worry we use software to do that.Two most popular software are xampp and wamp. First of all we have to download it from (www.apachefriend.com ,www.softtonic.com).Then,we install our software in c drive into programs file.After that ,Please go to c drive then go programme file and double click xampp or wamp folder.Among these folder we saved our php file into htdots folder.

What's next?


we complete our saved process.How can i view my php page.Open your browser and then type in address bar following  "localhost/my folder(the name of folder you saved your php page)".Press enter and a list of page will appear, from that list click your desire page.Finally you are able to view php page.Now if you view page source by clicking right button on mouse you will see that no php code is shown instead browser convert it into html tags. One important message for beginner that is wamp is better than xampp .Always use the latest version of wamp and xampp.Thanks for staying with us.

THE SUMMERY IS GIVEN BELOW:
--->Install xampp or wampp
--->Go to xampp or wampp folder on c drive
--->Save your file in htdots folder
--->Open your brower
--->Type localhsot/folder name in address bar
--->click your desire page from list

Introducton to php

Posted by Unknown on 2:03 AM comments (0)



Welcome to php world.Php stands for Hypertext preprocessor. It is server side scripting language. More than eighty percent web developer are using php instead of Asp.net and other language.Moreover php are open source,that means it can be used any where and by any person without  permission or paying . Especially php developed for web development.Those who have a background in programming language like c, c++, java can learn easily php.The basics syntax are almost same with these language.The new comer are become afrid by seeing php code,If anyone can overcome the initial fear,he or she must be fallen love with php.Furthermore,we can do a lot of work by codnd so on.For an instance,we create a table which is 50 row and 10 colums,for that we need atleast 60 line coding in html .Dramatically we can able to do same work just writing 6 to 7 line code sometime using one function.We create dynamic site with php.