Home | | Computer Application 12th Std | PHP - Basic Programing

Practical Experiments | Computer Applications - PHP - Basic Programing | 12th Computer Applications : Practical Experiments

Chapter: 12th Computer Applications : Practical Experiments

PHP - Basic Programing

To create and execute a basic PHP programming

PHP - Basic Programing

 

AIM

To create and execute a basic PHP programming

 

Procedure

1. Start Xampp server (Apache)

2. Goto virtual path folder (C:\xampp\htdocs)

3. Create test.php file and type the program

4. Execute the program on your Web browser using by this URL link (http://localhost/ test.php)


PROGRAM

<html>

<body>

<?php

echo “Welcome to Our School”;

$color = “blue”;

echo “My car is “ . $color . «<br>”;

echo “My dress is “ . $COLOR . «<br>”;

echo “My box is “ . $coLOR . «<br>”;

//test whether a number is greater than 30, 20 or 10 using ternary operator

functiontrinary_Test($n)

{

$r = $n > 30

“greater than 30”

: ($n > 20

“greater than 20”

($n >10

?“greater than 10”

:“Input a number atleast greater than 10!”));

echo $n.” : “.$r.”\n”;

}

trinary_Test(32);

trinary_Test(21);

trinary_Test(12);

trinary_Test(4);

?>

</body>

</html>


OUTPUT

Welcome to Our School

 

My car is blue

My dress is

My box is

 

32 : greater than 30

21 : greater than 20

12 : greater than 10

4 : Input a number atleast greater than 10!

Tags : Practical Experiments | Computer Applications , 12th Computer Applications : Practical Experiments
Study Material, Lecturing Notes, Assignment, Reference, Wiki description explanation, brief detail
12th Computer Applications : Practical Experiments : PHP - Basic Programing | Practical Experiments | Computer Applications


Privacy Policy, Terms and Conditions, DMCA Policy and Compliant

Copyright © 2018-2023 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.