Professional Documents
Culture Documents
Submitted by:
Of B.E.__________4th__________Semester (Branch________C.S.E_________)
Date: Date:
Marking Scheme:
2. For the lab record and internal viva voce 25 % marks is awarded, it is suggested that to avail good
number, submit the lab record and get it sign within 7 working days from the date of experiment
performed in the lab.
For the instructor, it is suggested that, if the lab record is submitted within 3 working days award A+
grade subject to lab experiment performed is without any mistakes, if it is submitted within 4
working days award A grade, if it is submitted within 5 working days award B+, within 6 working days
award B, and within 7 working days award C. After 7 working days mark Late on the Lab experiment.
INDEX
S.N TOPIC PAGE NUMBER
O.
1 Create a PHP webpage and print “hello world”
2 Write a PHP program to find maximum of three numbers
(experiment 4)
<?php
$num = 4;
$factorial = 1;
for ($x=$num; $x>=1; $x--)
{
$factorial = $factorial * $x;
}
echo "Factorial of $num is $factorial";
?>
(experiment 5)
<?php
function fact ($n)
{
if($n <= 1)
{
return 1;
}
else
{
return $n * fact($n - 1);
}
}
echo "Factorial of 6 is " .fact(6);
?>
(experiment 6)
Write a program for Student Mark List Processing by executing DDL, DML, DCL
commands on MySQL database.
(experiment 7)
<?php
// pass valid/invalid emails
$email = "mail@example.com";
if (filter_var($email, FILTER_VALIDATE_EMAIL))
{
echo '"' . $email . '" = Valid'."\n";
}
else
{
echo '"' . $email . '" = Invalid'."\n";
}
?>
(experiment 8)
<?php
//whether ip is from share internet
if (!empty($_SERVER['HTTP_CLIENT_IP']))
{
$ip_address = $_SERVER['HTTP_CLIENT_IP'];
}
//whether ip is from proxy
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
{
$ip_address = $_SERVER['HTTP_X_FORWARDED_FOR'];
}
//whether ip is from remote address
else
{
$ip_address = $_SERVER['REMOTE_ADDR'];
}
echo $ip_address;
?>
(experiment 9)
<?php
$a=1000;
$b=1200;
$c=1400;
echo "<table border=1 cellspacing=0 cellpading=0>
<tr> <td><font color=blue>Salary of Mr. A is</td> <td>$a$</font></td></tr>
<tr> <td><font color=blue>Salary of Mr. B is</td> <td>$b$</font></td></tr>
<tr> <td><font color=blue>Salary of Mr. C is</td> <td>$c$</font></td></tr>
</table>";
?>
(experiment 10)
<?php
$all_lines = file('https://www.bitraipur.ac.in/');
foreach ($all_lines as $line_num => $line)
{
echo "Line No.-{$line_num}: " . htmlspecialchars($line) . "\n";
}
?>