Abhishekkumar PHP
Abhishekkumar PHP
Abhishekkumar PHP
(UGCA-1930)
1922801
BCA 5
Output
Practical-2
Ques: Write a program to find area of the following shapes: circle, rectangle,
triangle, square, trapezoid and parallelogram.
Output
Practical-3
Ques: Compute and print roots of quadratic equation.
Output
Practical-4
Ques: Write a program to determine whether a triangle is isosceles or not?
Output
Practical-5
Ques: Write a program to sum of natural number given by the user from 1 to N.
Output
Practical-6
Ques: Write a program to print a multiplication table of the given input.
Output
Practical-7
Ques: Print Fibonacci Series up to n numbers e.g. 0 1 1 2 3 5 8 13 21……..n.
Output
Practical-8
Ques: Write a program to find factorial of any number.
Output
Practical-9
Ques: Determine prime numbers within a specific range.
Output
Practical-10
Ques: Write a program to compute , the Average and Grade of students marks.
Output
Practical-11
Ques: Compute addition, subtraction and multiplication of a matrix.
Output
Practical-12
Ques: Count total number of vowels in a word “Develop & Empower Individuals”.
Output
Practical-13
Ques: Determine whether a string is palindrome or not.
Output
Practical-14
Ques: Display word after sorting in alphabetical order.
Output
Practical-15
Ques: Check whether a number is given range using functions.
Output
Practical-16
Ques: Create a web page to accept a strings a string and calculates number of
upper case and lower case letters available in that string.
Output
Practical-17
Ques: Design a program to reverse a string word by word.
Output
Practical-18
Ques: Create a web page with login form. On submitting the form user should
navigate to the profile page.
Output
Practical-19
Ques: Design a front page of a college or department using graphics method.
<?php
$image= imagecreate(1500,1500);
$bg=imagecolorallocate($image,100,125,255);
//Background
for($i=1200;$i<=1500;$i +=$size){
$r=rand(1,255);
$g=rand(1,255);
$b=rand(1,255);
imageline ($image,$i,1200,$i,1500,$text_color);
// Horizontal lines
for($i=1200;$i<=1500;$i +=$size){
$r=rand(1,255);
$g=rand(1,255);
$b=rand(1,255);
imageline ($image,0,$i,1500,$i,$text_color);
//Top Line
$txtline=imagecolorallocate($image,0,0,0);
imageline ($image,10,30,1490,30,$txtline);
//Bottom Line
$txtline=imagecolorallocate($image,0,0,0);
imageline ($image,10,100,1490,100,$txtline);
//Left Line
$txtline=imagecolorallocate($image,0,0,0);
imageline ($image,10,30,10,100,$txtline);
//Right Line
$txtline=imagecolorallocate($image,0,0,0);
imageline ($image,1490,30,1490,100,$txtline);
$txtline=imagecolorallocate($image,0,0,0);
imageline ($image,10,120,1490,120,$txtline);
$txtline=imagecolorallocate($image,0,0,0);
imageline ($image,10,1190,1490,1190,$txtline);
$txtline=imagecolorallocate($image,0,0,0);
imageline ($image,10,120,10,1190,$txtline);
$txtline=imagecolorallocate($image,0,0,0);
imageline ($image,1490,120,1490,1190,$txtline);
$txt=imagecolorallocate($image,25,25,25);
$txt1=imagecolorallocate($image,255,0,0);
$txt2=imagecolorallocate($image,0,255,0);
$txt3=imagecolorallocate($image,255,0,0);
imageline ($image,0,$i,1500,$i,$text_color);
imagestring($image,25,20,50,"HOME",$txt1);
imagestring($image,25,70,50,"WHO WE ARE",$txt);
imagestring($image,25,170,50,"COURSES",$txt);
imagestring($image,25,250,50,"FACULTY",$txt);
imagestring($image,25,320,50,"STUDENT-ZONE",$txt);
imagestring($image,25,450,50,"NIRF",$txt);
imagestring($image,25,510,50,"ADMISSIONS 2022",$txt);
imagestring($image,25,1250,50,"SIGN UP",$txt2);
imagestring($image,25,1350,50,"SIGN IN",$txt3);
Technology. It is north India's premier destination in fields of management and computer ",$txt);
header("Content-Type:image/png");
imagepng($image);
imagedestroy($image);
?>
Output
Practical-20
Ques: Design a web page to upload and download a files.
Uploading file
<html>
<body>
<h1>Uploading a file</h1>
<br><br>
</form>
</body>
</html>
Upload.php
<?php
$target_dir = "E:\Upload";
$uploadOk = 1;
$imageFileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION));
if(isset($_POST["submit"])) {
$check = getimagesize($_FILES["fileToUpload"]["tmp_name"]);
} else {
$uploadOk = 0;
if (file_exists($target_file)) {
$uploadOk = 0;
$uploadOk = 0;
echo "Sorry, only JPG, JPEG, PNG & GIF files are allowed.";
$uploadOk = 0;
if ($uploadOk == 0) {
} else {
if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) {
echo "The file ". htmlspecialchars( basename( $_FILES["fileToUpload"]["name"])). " has been
uploaded.";
} else {
?>
Output