PHP Programs PDF
PHP Programs PDF
1) Design Student Signup Form Using HTML, JavaScript, HTML5 & CSS- (save this
le as “.html”)
OUTPUT-
fi
2) Step for installing PHP & Con guring XAMPP-
• The acronym XAMPP stands for cross- Platform, PHP, Apache, MySQL,
Perl and PHP for ‘PHP hyper text Preprocessor’
• XAMPP is a free and open source web serve that allows you to develop,
text and build websites or a local server.
• When it’s done downloading go to your download right click on the setup le
(.exe) and select “run as administrator”
• This will take you the setup - XAMPP wizard, click next and you’ll be able to
select the components you want and then you’ll come to the installation
folder. You have to select a folder where you want to install XAMPP
• Select the installation language as English, you’ll get Bitname for XAMPP
• And you are ready to install while the installation process completes, when
it’s done click ok.
• Once the installation process is nished, you can now use XAMPP in your
project.
• Set the path under System Properties —> enviornment variables —>
(location of php) d:\XAMPP\PHP
• To run the PHP program with XAMPP, go to the “XAMPP” folder and open it.
You should see a folder named “htdocs”. Open it then create a new folder in
it.
• Next, open your VS code, click on open folder, then go to the location where
you saved the folder you created (htdocs/foldername).
fi
fi
fi
fi
fi
fi
fi
• Create a le with the extension “.php” example test.php. PHP is run with the
<?php…?> tag.
• After writing the code, open the XAMPP control panel, and start the Apache
module by Clicking on start then go to your web browser and in the search
bar type local host/Demo (folder name) /test.php, then enter. Output will be
displayed - (save this le as “.php”)
OUTPUT-
fi
fi
3)Write a program in PHP for type cas ng of a variable (save this le as “.php”)
OUTPUT-
ti
fi
4) Write a program in PHP to display Mul plica on Table using nested for loop (save this le as
“.html”)
OUTPUT-
ti
ti
fi
5) Write a program In PHP to Sort an array using Bubble Sort func on (save this le
“.php”)
OUTPUT-
ti
fi
6) Design the personal informa on form, submit and retrieve the form data using php
$_POST,$_GET,$ REQUEST variable (save this le as “.php”
ti
fi
OUTPUT-
A er clicking Submit-
ft
7) Write a PHP program to keep track of the number of visitors visi ng the web page and
to display this count of visitors, with proper headings. (Save this le as “.php”)
Note: (Create a text le with”count.txt” name and set the value to “1”)
OUTPUT-
fi
fi
ti
8) Write a PHP program to use a cookie to remember the day of the last login from a user
and display it when run. (Save this le as “.php”)
OUTPUT-
fi
9) Write a program to demonstrate DOM parser (save this le has “.html”)
OUTPUT-
fi
10) Create a registra on form which stores the registra on details into the database
table.
HTML Code- First run this program (“insert.php”) this will call another program. (Save
this le as “html”)
fi
ti
fi
ti
OUTPUT-
A er entering the details and clicking the Submit bu on this output will come-
A er this open “phpmyadmin” site and open your database and you will see this output-
ft
ft
tt