Web Programming II – Solutions – 2016

11. Write a PHP program to create a web form that contains a textbox for names, and checkboxes for hobbies. When a form is submitted, check a name is entered, and at least one of the hobbies is selected. <!doctype html> <html> <head> <title>Year : 2016 | Q : 11</title> </head> <body> <form method = […]

Web Programming II – Solutions -2017

11. Write a PHP code to perform server-side validation. (Check for empty, alphabets, numbers, email and password length validation) <!doctype html> <html> <head> <title>Year : 2017 | Q : 11</title> </head> <body> <?php function validate($n,$a,$e,$p) { //Checking for empty spaces if($n==”||$a==”||$e==”||$p==”){ echo ‘Empty spaces not permitted’; return false; } //Checking for numbers $regN = “/^[A-Z]+[A-z\s]+[a-z]$/m”; […]