I have a form which is submitted using a link. However, when I try to use isset, it doesn’t seem to work,
<form name="xForm" action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>" method="post">
<input type="text" name="aff" class="make" value="" />
<a href="#" title="" class="pay-button" style="margin-top:5px;" name="submit" onclick="document.xForm.submit()">SUBMIT</a>
</form>
if(isset($_POST['submit']))
{
$aff = $_POST['aff'];
}
Any help will be appreciated. Thanks
You don’t have any form element named “submit”.
Either add such as hidden input, or check the text box name:
The anchor name is not relevant.
The code for hidden input is:
Adding it to the form, you will get the value “true” when the form will be submitted.
The above (adding hidden input named submit) is not good idea as it will cause the code
ocument.xForm.submit()to fail – if you choose hidden input just give it other name.