Home  >  Article  >  Backend Development  >  Form submission PHP form submission to itself

Form submission PHP form submission to itself

WBOY
WBOYOriginal
2016-07-29 08:38:25993browse

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: