[text]<form method="post" action="view.php">
<td width = "10% align="middle"><input align="middle" type="submit" value= " View Cart" size = "11"/></td>
</form[/text]
This code is called by the code above:
<
Code: Select all
html>
<body>
<?php
echo "hello world";
$myfile = "CartFile.txt";
$fh = fopen($myfile,'r');
if ($fh) {
while (!feof($fh)) {
$buffer = fgets($fh);
echo $buffer;
}
fclose($fh);
}
?>
</body>
</html> Code: Select all
$txt = "Eagle: " . "Quantity: " . $FQ3 . " " . "Wood: " . $wood_status . " " . "Base: " . $base_status . " " . "Clock/Picture: " . $cp_status;
fwrite($fh,$txt); What's happening when I execute this code, on my screen, I see a black page come up and then the routines takes me back to my sites Home page.
I have learned that when PHP wants to use data from HTML form you code something like this:
Code: Select all
$FQ1 = $_POST["Quantity1"];My problem or question, how to a get the data, read via the print routine above, displayed on a Form.
To maybe give you a better idea of what I am trying to do is: I developed an Order Form that writes records to a flat-file called CartFile.txt(the code above is how it's done). On the form, I have a Submit button called "View Cart". When the user clicks the "View Cart" button, I want to display there order.