hi all,
I have a php assignment for school and I don’t understand much about it. I have to make a shopping list (apples, bread, milk etc.) where I can tick different products and add them using the send button.
In the meantime I have figured out how that works. But I also need to be able to remove the products that have been ticked and added to the shopping list via a second send button.
So the data has to be saved in a session.
Does anyone have any idea how this works?I don’t get it.
This is my html code: (is it good or do i need to change some things?)
`<!DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”utf-8″>
<title>Grocery list</title>
</head>
<body>
<h1>GROCERY LIST</h1>
<form action=”hoi.php” method=”post”>
<input type=”checkbox” name=”chips” value=”j”> Potato chips<br><br/>
<input type=”checkbox” name=”bread” value=”j”> Bread<br><br/>
<input type=”checkbox” name=”cola” value=”j”> Coca Cola<br><br/>
<input type=”checkbox” name=”milk” value=”j”> Milk<br><br/>
<input type=”checkbox” name=”apples” value=”j”> Apples<br><br/>
<input type=”checkbox” name=”tomatoes” value=”j”> Tomatoes<br><br/>
<input type=”checkbox” name=”cheese” value=”j”> Cheese<br><br/>
<input type=”checkbox” name=”lemon” value=”j”> Lemon<br><br/>
<input type=”submit” name=”send1″ value=”Add to grocery list”>
<input type=”submit” name=”send2″ value=”Delete from grocery list”>
</form>
<br><br>
<p1>My grocery list:</p1>
</body>
</html>
`
Does anyone has any clue how to make the php code for this one:
I would really appreciate it if someone could help me with this 😁