I’ve gota working form that when you click “submit” it takes you to a results page – all fine.
However, is it possible to add divs etc to make the page look a bit nicer? If so, how? At the moment when i add divs in it just ignores them!
Thanks,
Steph
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="shortcut icon" type="image/x-icon" href="images/favicon.ico" />
<link rel="stylesheet" href="styleResults.css" type="text/css" media="all" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<TITLE>Ideo Accounting - Results</TITLE>
</head>
<body>
<H2>Results</H2>
<?
$customers = $_POST['customers'];
$suppliers = $_POST['suppliers'];
$bank = $_POST['bank'];
$creditcard = $_POST['creditcard'];
$totalqty = 0;
$totalamount = 0.00;
define("PRICE", 0.75);
$totalqty = $customers + $suppliers + $bank + $creditcard;
$totalamount = number_format($totalqty*PRICE, 2);
echo "<BR>\n";
echo "Total transactions: $totalqty<br>\n";
echo "Estimated monthly fee: £$totalamount<BR>\n";
?>
</body>
</html>
You can put any HTML styling elements in between the
"double quotes after theechostatements, they will definitely not be ignored.Look into your browser’s “view source” page to see whether they get output or not. My guess is the
divs you output have no CSS styling at all, so you won’t see anything.Code improvement suggestion:
It might be easier to work with the HTML if you change its structure a bit. Remove the three
echolines, and after the?>addthe PHP output is then part of your HTML code, and you can place
divs and other elements as you please without having to take care not to break the PHP string. You can even move the<?php=$...?>snippets around, you just have to be careful that they stay intact.