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>
Run Code Online (Sandbox Code Playgroud)
myformsubmit.php
<html>
<head>
....
</head>
<body>
<?php if (count($_POST)>0) echo '<div id="form-submit-alert">Form Submitted!</div>'; ?>
...
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
已编辑符合上次编辑时 OP 的新标准。
EDITv2在家尝试一下!
<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>
Run Code Online (Sandbox Code Playgroud)
试穿一下尺寸。
| 归档时间: |
|
| 查看次数: |
64920 次 |
| 最近记录: |