This is the PHP program that I did successfully for the first time.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title> | |
This is an php tutorial | |
</title> | |
</head> | |
<body> | |
<form action="learnphp.php" method="post"> | |
<table border="0"> | |
<tr> | |
<td>Name</td> | |
<td align="center"><input type="text" name="username" size="30" /></td> | |
</tr> | |
<tr> | |
<td>Address</td> | |
<td align="center"><input type="text" name="streetaddress" size="30" /></td> | |
</tr> | |
<tr> | |
<td>City</td> | |
<td align="center"><input type="text" name="cityaddress" size="30" /></td> | |
</tr> | |
<tr> | |
<td colspan="2" align="center"><input type="submit" value="Submit" /></td> | |
</tr> | |
</table> | |
</form> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Information Gathered</title> | |
</head> | |
<body> | |
<?php | |
define('PI', 3.14); | |
echo "The value of PI is" . PI; | |
echo "</br> 5 + 2 =" . (5 + 2); | |
echo "</br> 5 - 2 =" . (5 - 2); | |
echo "</br> 5 * 2 =" . (5 * 2); | |
echo "</br> 5 / 2 =" . (integer)(5 / 2); | |
echo "</br> 5 % 2 =" . (5 % 2); | |
$usersName=$_POST['username']; | |
$streetAddress=$_POST['streetaddress']; | |
$cityAddress=$_POST['cityaddress']; | |
echo $usersName . "</br>"; | |
echo $streetAddress . "</br>"; | |
echo $cityAddress . "</br>"; | |
$str = <<<EOD | |
The coustomer name is $usersName and he lives in $streetAddress at $cityAddress </br> | |
EOD; | |
echo $str; | |
?> | |
</body> | |
</html> |
No comments:
Post a Comment