Webbserv1: Källkod
Webbserverprogrammering 1

Show sourcecode

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

webbsrvprg/exercises/

index.php
ovn_class1.php
ovn_class2.php
ovn_class3.php
ovn_class4.php
ovn_class5.php
ovn_class6.php
ovn_class7.php
ovn_cook1.php
ovn_cook2.php
ovn_cook3.php
ovn_cook3_2.php
ovn_cook4.php
ovn_form1.php
ovn_form2.php
ovn_form3.php
ovn_form4.php
ovn_form5.php
ovn_form6.php
ovn_form7.php
ovn_form8.php
ovn_funk1.php
ovn_funk2.php
ovn_funk3.php
ovn_funk4.php
ovn_funk5.php
ovn_funk6.php
ovn_gr1.php
ovn_gr2.php
ovn_gr3.php
ovn_gr4.php
ovn_gr5.php
ovn_gr6.php
ovn_inc1.php
ovn_inc1_2.php
ovn_inc2_1.php
ovn_inc2_2.php
ovn_inc2_3.php
ovn_inc2_sidslut.php
ovn_inc2_sidstart.php
ovn_str1.php
ovn_str2.php
ovn_str3.php
ovn_str4.php
ovn_str5.php
ovn_uppg1.php
ovn_uppg2.php
ovn_uppg3.php
ovn_uppg4.php
ovn_uppg5.php
ovn_uppg6.php

ovn_form7.php

41 lines UTF-8 Windows (CRLF)
<!DOCTYPE html>
<html>
<body>

<?php
 
function medelvärde($x$y$z) {
  return (
$x $y $z)/3;
 }

 
$meddelande "";
 
$total 0;
 if (isset(
$_POST["tal1"])) {
  
$tal1 $_POST["tal1"];
  
$meddelande .= $tal1.", ";
  
$total += $tal1;
 }
 if (isset(
$_POST["tal2"])) {
  
$tal2 $_POST["tal2"];
  
$meddelande .= $tal2.", ";
  
$total += $tal2;
 }
 if (isset(
$_POST["tal3"])) {
  
$tal3 $_POST["tal3"];
  
$meddelande .= $tal3.", ";
  
$total += $tal3;
  
$medelvärde medelvärde($tal1$tal2$tal3);
  
$meddelande .= "Medelvärde: ".$medelvärde;
 }
 echo 
$meddelande;
?> 

<form method="POST" action="">
 <p>Skriv tal i rutorna</p>
 <input type="text" name="tal1">
 <input type="text" name="tal2">
 <input type="text" name="tal3">
 <input type="submit" value="skicka">
</form>

</body>
</html>