Webbserverprogrammering 1

Show sourcecode

The following files exists in this folder. Click to view.

webbsrvprg/exercises/

InlämningsFormulär.php
include1.php
include2.php
includesid1.php
includesid2.php
includesid3.php
phpformulär1.php
phpformulär2.php
phpslump6.php
sidslut.php
sidstart.php
test.php
övning1.php
övning2.php
övning3.php
övning4.php
övning5.php
övningfunk1.php
övningfunk2.php
övningfunk3.php
övningfunk4.php
övningfunk5.php
övningfunk6.php
övningtest.php

övning3.php

40 lines ASCII Windows (CRLF)
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

<?php
    
echo "<h1>For-lopp</h1>";

    
$summa = 0;

     for (
$tal = 1; $tal <= 100; $tal++) {
            
$summa = $summa + $tal;
    }

     echo 
$summa;

 echo 
"<br>";
 echo 
"<br>";
 echo 
"<h1>while-lopp</h1>";

   
$summa2 = 0;
   
$tal2 = 1;

     while (
$tal2 <= 100) {
         
$summa2 = $summa2 + $tal2;
         
$tal2++;
    }

     echo 
$summa2;

?>



</body>
</html>