I want a form with 4 submit buttons. Once any of them is pressed, they shell call the same page with different content. To determine which content it is, I will write a PHP Script, but I have not come that far yet. My Problem on the way is, that I need to pass the value along.
I found an answer to my question in here ( Two submit buttons in one form ). I copied and adjusted the code but it is not working. When I want to access the $_POST array with my defined name, it says it is an unknown index. This is my relevant code so far.
<div>
<form action="nutzerverwaltung.php" method="post">
<input type="submit" class="nv_select" name="nv_select" value="Nutzer hinzufuegen" />
<input type="submit" class="nv_select" name="nv_select" value="Nutzer loeschen" />
<input type="submit" class="nv_select" name="nv_select" value="Nutzer bearbeiten" />
<input type="submit" class="nv_select" name="nv_select" value="Alle Nutzer anzeigen" />
</form>
<br />
</div>
<?php if ($_POST["nv_select"] == "Nutzer hinzufuegen") echo "Hallo"; ?>
What am I doing wrong??
John