Programming in PHP

Simple PHP

Posted on Updated on

<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>

program in to php accepts user information
program in to php accepts user information
Advertisements

Form in PHP

Posted on Updated on

<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>

Form_php1
Form_php1

Contol Statement in PHP

Posted on Updated on

<?php

$day=Date(“D”);

if($day==”Sat”)

echo ” Have a nice week end”;

else

echo “Have a nice day”;

?>

Output of Control Statement
Output of Control Statement

<?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”;

?>

Output of Control Statement
Output of Control Statement