I'm simply trying to get an action when a button is clicked, but when I click the btnAdd nothing happens...
<html>
<head>
<title>Add New User</title>
</head>
<body>
<form action="addUser.php" method="post">
<h1>Add New User</h1>
<table>
<tr>
<td></td>
<td><input type="button" name='btnAdd' value="Add" ></td>
</tr>
</table>
<?php echo("itch"); ?>
<?php print('itch'); ?>
<?php
if (isset($_POST['btnAdd']))
{
print("btn test");
//testFunction();
}
</form>
</body>
</html>
new to php, trouble with $POST
Moderator: General Moderators
Re: new to php, trouble with $POST
1. You should be getting a parse error because a PHP closing tag is missing after the if block.
2. An <input type="button"> does not submit a form, but an <input type="submit"> does.
3. Please use BBCode tags in your posts. Try the PHP Code button on the submission form.
2. An <input type="button"> does not submit a form, but an <input type="submit"> does.
3. Please use BBCode tags in your posts. Try the PHP Code button on the submission form.
Re: new to php, trouble with $POST
okay thanks! Those changes worked.