Write a complete PUP enabled website using WebMatrix At the

Write a complete PUP enabled website using WebMatrix. At the beginning, choose the template of empty PHP website or empty HTML website. In the major PUP file of this site, i.e. index.php, inside PHP script block, write PHP code to print out first 10 prime numbers inclusively starting with 2. Print these numbers in one line and separate them with two spaces. You MUST use PHP output statement, flow control statements for selection and loop control structures in PHP.

Solution

Need to create two files named template.php and index.php

template.php

<html>
<head>
<title> PHP include Website Template</title>
</head>
<body>
<?PHP include \"index.php\"; ?>
</body>
</html>

index.php

<?php
$count = 0 ;
$number = 2 ;
while ($count < 10 )
{
$div_count=0;
for ( $i=1;$i<=$number;$i++)
{
if (($number%$i)==0)
{
$div_count++;
}
}
if ($div_count<3)
{
echo $number.\" \";
$count=$count+1;
}
$number=$number+1;
}
?>

 Write a complete PUP enabled website using WebMatrix. At the beginning, choose the template of empty PHP website or empty HTML website. In the major PUP file o

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site