Webbserverprogrammering 1

Show sourcecode

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

webbsrvprg/ovningar/form/

form1.php
form2.php
form3.php
form4.php
form5.php
form6.php
form7.php
ovn_form1.html
ovn_form1.php
ovn_form2.htm
ovn_form2.php
ovn_form3.html
ovn_form3.php
ovn_form4.html
ovn_form4.php
ovn_form5.html
ovn_form5.php
ovn_form6.html
ovn_form6.php
ovn_form7.html
ovn_form7.php
ovn_form8.html
ovn_form8.php

ovn_form8.html

31 lines ASCII Windows (CRLF)
<!DOCTYPE html>
<html lang="en">
<body>
  
<?php
error_reporting
(-1); // Report all type of errors
ini_set('display_errors'1); // Display all errors
ini_set('output_buffering'0); // Do not buffer outputs, write directly
?>


<?php 
  
if(isset($_POST["name1"])&& $_POST["name1"]!=""){
    
$num1 $_POST["name1"];
    
$num2 $_POST["name2"];
    
$num3 $_POST["name3"];
    
$average = ($num1 $num2 $num3) / 3;
    echo 
$average;
  }
?>  

<form method="post" action="">
  <input type="text" name="name1" placeholder="Nummer 1">
    <input type="text" name="name2" placeholder="Nummer 2">
    <input type="text" name="name3" placeholder="Nummer 3">
  <input type="submit" name="skicka">
    
 </form>

</body>
</html>