Showing posts with label PHP. Show all posts
Showing posts with label PHP. Show all posts

Sunday, November 9, 2014

Embedding PHP on HTML

Program:

<?php
     $teta="last name";
?>
<input type="text" name="name" value="<?php echo $teta; ?>"> 

Screenshot

Program



Output




Indentation In PHP

Indentation:

It means using Curly brackets { } in programming.

<?php
//indentation two types....1.end of line indentation

$text=15;
if($text==15){     //  here this is the end of line indentation
echo 'The number is really fifteen';
}else{
echo 'The number is not fifteen';
}
//  2.next line indentation

$text=12;
if($text==15)
{     //  here this is the next line indentation
echo 'The number is really fifteen';
}
else
{
echo 'The number is not fifteen';
}
?>

Output:

The number is really fifteen
The number is not fifteen 


Screenshots:

Program:


Output


Wednesday, September 24, 2014

Simple Hello World Program In PHP

Program:

<?php
     echo 'hello world';

?>

Output In the browser:    hello world


Screenshots

Program


Output



Sunday, August 24, 2014

Concept of variables in PHP

Program:

<?php
echo 'ami akhon php shikhtesi:i\'m now learning php';

$deal = 'php';

$vat = 'learning';

echo 'ami akhon '.$deal.' shikhtesi:i\'m now '.$vat.' '.$deal.'';
?>

Screenshots


Output


Print a simple line in PHP

Program:

<?php
echo 'ami akhon php shikhtesi:i\'m now learning php ';
?>

Screenshots


Output





Saturday, August 23, 2014

Linking PHP to server by XAMPP

Linking PHP:

1.After downloading XAMPP,you have to install it to your C drive.
2.When install it successfully,then you have to find the C:/>xampp>htdocs .
3.All PHP file will be saved on the htdocs folder.

Now follow the screenshots below:

Screenshots

Step 1:installing Xampp in c drive



Step 2:Saving file directory


Step 3:Saving my php file


Open the program editor like notepad++.Then create a new file and save it the name as your wish on the directory.The file must be a .php(dot php) file.I have saved it as panaroma.php file.

Follow the screenshots:



Screenshots





So,now after saving the file as panaroma.php,go to the browser and write localhost.

But before that you have to remember the XAMPP server was run and start or not.

on your browser you can see:

Screenshots



Next after writing localhost/panaroma.php or which you saved that file to C:/>xampp>htdocs>your saving file on your browser.

Screenshot


This will appear.Because I have saved that file by writing this program on notepad++ as the name of panaroma.php.

Screenshot




Friday, August 22, 2014

Simple PHP in notepad++

Program:

<?php
phpinfo();
?>


Screenshots



2


Downloading and Installing XAMPP in PHP

About XAMPP:

XAMPP is a free and open source cross-platform web server solution stack package, consisting mainly of the Apache HTTP Server, MySQL database, and interpreters for scripts written in the PHP and Perl programming languages.

Downloading XAMPP:

Go to     this link.

And download the XAMPP file for windows or linux or mac,which operating system you r using.
follow the screenshots below:

Screenshots





Installing and run the XAMPP: 

Double click and install the downloaded file and it will automatic run.
Follow the screenshots below:

Screenshots


After installing and run the downloaded file,this type of screen will appear.

Then for PHP click the start button of apache and mysql.

Follow the screenshots.