It's as simples as a form can get. However, it's not working at all.
The HTML form:
<body>
<form method="POST" action="porra.php">
<div id="refeicao">
<h1>Segunda</h1>
Café da manhã
<br><input name="Cafe da manhã-quantidade-0" type="number" min="0" placeholder="un." />
<input type="submit" name="submit"/>
</form>
<script src="gerar_cardapio_js.js" language="Javascript" type="text/javascript"></script>
</body>
The PHP code (page "porra.php"):
<?php
$var = $_POST["Cafe da manhã-quantidade-0"];
?>
However, i get this error after submission:
Notice: Undefined index: Café da manhã-quantidade-0 in C:\xampp\htdocs\cardapio\porra.php on line 2
Can someone please make this work?
EDIT:
I edited the code to correct a typo and to elimnate code that I was not using for this question.