Home
Software Programming Learning
EDA & IP & IC
Goodies
News
Contact Us
Article
Contents Of Article
Previous Article
SNO:
Writer:
Next Article
Title:
<?php $flag = 0; if (!empty($_POST['message'])){ $m1 = $_POST['message']; } else { $m1 = 10; $flag = 1; } switch ($m1) { case 1: $message = "It's a wonderful world!"; break; case 2: $message = "Have a nice day!"; break; case 3: $message = "You can find lots of fun in HTML5/PHP world!"; break; case 10: $message = "This message should never show up!"; break; default: $message = "Strange status!"; } ?> <!doctype html> <html> <head> <meta charset="utf-8"> <title>HTML5/PHP Demo Example</title> <style> div { text-align:center; font-family:Calibri; font-weight:bold; font-size:20px; color:#0070C0; } </style> </head> <body> <div> <h3>HTML5/PHP Demo Example</h3> <form method="post" action="html5phpdemo1.php"> Message 1:<input type="radio" name="message" value="1" <?php if ($m1 == 1 || $m1 == 10) echo 'checked'; ?>/> 2:<input type="radio" name="message" value="2" <?php if ($m1 == 2) echo 'checked'; ?>/> 3:<input type="radio" name="message" value="3" <?php if ($m1 == 3) echo 'checked'; ?>/><br/> Message Font Size: <select name="fontsize"> <option value="h1" <?php if ($_POST["fontsize"] == h1) echo 'selected="on"'; ?>>h1</option> <option value="h2" <?php if ($_POST["fontsize"] == h2) echo 'selected="on"'; ?>>h2</option> <option value="h3" <?php if ($_POST["fontsize"] == h3) echo 'selected="on"'; ?>>h3</option> <option value="h4" <?php if ($_POST["fontsize"] == h4) echo 'selected="on"'; ?>>h4</option> </select><br/> <input type="submit" value="Enter"/><br/> </form> <?php if ($flag != 1) { echo ' <'.$_POST["fontsize"].'>Message block: '.$message.'</'.$_POST["fontsize"].'>'; } ?> <h3><a href="http://www.advtechlink.com/article-1.php?sno=60" target="_blank">Click Here to Read the Source Code</a></h3> </div> </body> </html>
Previous Article
Next Article