Home Backend Development PHP Tutorial Form submission PHP form submission to itself

Form submission PHP form submission to itself

Jul 29, 2016 am 08:38 AM
form submission

In most cases, we specify another URL address to process the form content to the Action attribute, but in some cases, we need to submit the form data to ourselves. How should we specify the Action attribute value at this time?
if (isset($_POST['action']) && $_POST['action'] == 'submitted') {
print '

'; <br> print_r($_POST); <br> print '<a href="'. $_SERVER['PHP_SELF'] .'">Please try again</a>'; <br> print '
';
} else {
?>

Name:
Email:

Beer: