pagewithform.php
<html>
<head>
...
</head>
<body>
...
<form action="myformsubmit.php" method="POST">
<label>Name: <input type="text" name="name" /><label>
<input type="Submit" value="Submit" />
</form>
...
</body>
</html>
myformsubmit.php
<html>
<head>
....
</head>
<body>
<?php if (count($_POST)>0) echo '<div id="form-submit-alert">Form Submitted!</div>'; ?>
...
</body>
</html>
EDITED Suitable for the new OP criterion at the last edit.
EDITv2 Try it at home!
<html>
<head>
<title>Notify on Submit</title>
</head>
<body>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
<label>Name: <input type="text" name="name" /></label>
<input type="submit" value="Submit" />
</form>
<?php if (count($_POST)>0) echo "Form Submitted!"; ?>
</body>
</html>
Try this for size.
source
share