I have a "small project" at school to create a small calculator with xhtml 1.0 strict and php. The result must be displayed on the same page.
When I put the code on http://validator.w3.org/check to be validated I get the fallow error:
Line 88, Column 9: end tag for "form" omitted, but OMITTAG NO was specified ✉ You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".
Thank you to anybody that's trying to solve my problem!
The code:
<?php
require_once('base.php');
require_once('functions.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Calculator</title>
<link href="styles.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form method="post" action="calculator.php">
<div id="number1">
<p>1er numéro :
<input type="text" name="field1" value="<?php if(isset($_POST['field1'])) { echo $_POST['field1']; } ?>" />
</p>
</div>
<div id="number2">
<p>2eme numéro:
<input type="text" name="field2" value="<?php if(isset($_POST['field2'])) { echo $_POST['field2']; } ?>" />
</p>
</div>
<div id="operation">
<p>opération :
</p>
<select name="field3">
<option value="">Choisissez l'operateur:</option>
<?php
echo myselect();
?>
</select>
</div>
<div id="submit">
<input type="submit" name="submit" value="Calculé" />
</div>
<div id="result">
<?php
if(isset($_POST['submit'])) {
echo mycalculator();
}
?>
</div>