Hi!
For my school project I have to code a shopping cart page only with HTML, CSS and PHP (bootstrap, sql js,... are not allowed).
But I don't know how to code in php (it's my first time).
The cart must display the name and quantity of the chosen product in a list.
Here is what I did:
<?php
$quantity= $_POST['quantity'];
$price = $_POST['price'];
$name= $_POST['name'];
$total = $name* $price;
$data= array("$quantity","$price","$total");
$D4 = fopen('cart.txt','a');
fwrite($D4,"$name|$quantity|$price|$total|@");
fclose($D4);
?>
The information is written to a text file. I would like this information to be written on an html page (a shopping cart page).
I don't know how to do this...
Can you help me?
Thanks a lot!