Programming in PHP
Simple PHP
<html><head><title>A Simple PHP page that accepts user information</title></head>
<body> <div> <?php print “Welcome “.$_GET[‘user’].”<br>”; print “You came from “.$_GET[‘address’].”<br>”; ?></div> </body> </html> |
Form in PHP
<html><head> <title>A Simple HTML page to provide information for PHP</title></head> <body> <div> <form action = “pp1.php” method = “get”> <p>User Name : <input type = “text” name = “user”></p> <p>Address : <textarea name = “address” rows = “3” cols=”30″></textarea></p> <p><input type = “submit” value = “Send”></p> </form></div> </body> </html> |
Contol Statement in PHP
<?php
$day=Date(“D”);
if($day==”Sat”)
echo ” Have a nice week end”;
else
echo “Have a nice day”;
?>

<?php
$d=date(“D”);
if ($d==”Sat”)
{
echo “Hello!<br />”;
echo “Have a nice weekend!<br>”;
echo “See you on Monday!”;
}
else
echo “have a nice day”;
?>
