Page 246 - Computer Software Application TP - Volume 1
P. 246
COMPUTER SOFTWARE APPLICATION - CITS
TASK 7: Using for statement
1 Open the text editor
2 Write the following codes
<html>
<head> <title>PHP </title></head>
<body>
<?php
for ($x =1; $x <=10; $x++)
{
echo “The number is: $x <br>”;
}
?>
<p>END</p>
</body>
</html>
3 Save the program in C:\Apache24\htdocs in a folder with .php extension
4 Run the Apache services from windows services
5 Open the browser and type the following address
http://localhost/foldername/
6 Click the php file to run and verify the output
231
CITS : IT & ITES - Computer Software Application - Exercise 51