Tuesday, 7 March 2017

Age validation in php

1) A web application that takes name and age from an HTML page. If age is less than 18, it should send a page with "Hello <name>, you are not authorized to visit this site" message, where <name> should be replaced with the entered name. Otherwise it should send "Welcome <name> to this site" message.

Solution:  This program can be done using the XAMPP server or WAMP server. First you need to install anyone of the server in your respective system.
                Here I am using the XAMPP server and executing this program.
First open the XAMPP server and the Apache is started. It is shown in the following picture.
Next write the userlogin.html file in the notepad.
Then write the p.php file in the notepad.
Then open the browser and type the address as "http://localhost:8080/....(folder name which u created in the htdocs folder of xampp server)"
Then click on the userlogin.html in the list then the below screen will be observed.
Then the output screen will be like this.






In this way we can execute the php program using Xampp server.






No comments:

Post a Comment