So, using PHP, I'm trying to make a simple poll for my website and I've hit a block which I can't seem to get around.
To explain this as short as possible, I've got a form, in which I'm displaying the values from the database, and it all works fine. Using a post method, I thought I'd submit the data to the next page, here's the troublesome code:
echo "<tr><td><input type='submit' name='glasaj' value='Glasaj'></td>";
echo "<td><input type='submit' name='rez' value='Rezultati'></td></tr>";
Basically, just two submit buttons in a form using a post method, so the problem occurs when I try to get the attribute names in the php file where the data is being submitted:
$glasanje = $_POST['glasaj'];
$rezultati = $_POST['rez'];
And the errors the PHP outputs are:
Notice: Undefined index: glasaj in C:\wamp\www\WebProg\79_a.php on line 7
Notice: Undefined index: rez in C:\wamp\www\WebProg\79_a.php on line 8
What did I do wrong here?