【发布时间】:2022-01-11 20:50:16
【问题描述】:
我一直在写一个 HTML 页面,我会在下面放一个,我也会发布一个 PHP 脚本。但是当我使用 HTML 页面编写信息并提交时,我得到“在此服务器上找不到请求的 URL”。消息,我将所有文件放在名为“html”的 htdocs 上的一个文件夹中,html 页面名为“index”,脚本名为“test”,非常感谢您的宝贵时间。
[HTML 代码]
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="/docs/4.0/assets/img/favicons/favicon.ico">
<title>Signin Template for Bootstrap</title>
<link rel="canonical" href="https://getbootstrap.com/docs/4.0/examples/sign-in/">
<!-- Bootstrap core CSS -->
<link href="../../dist/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="signin.css" rel="stylesheet">
</head>
<body class="text-center">
<form method="post" action="next.php">
<img class="mb-4" src="https://getbootstrap.com/docs/4.0/assets/brand/bootstrap-solid.svg" alt="" width="72" height="72">
<h1 class="h3 mb-3" font-weight="normal"> Please sign in </h1>
<label for="inputEmail" class="sr-only">Email address</label>
<input type="email" id="inputEmail" class="form-control" placeholder="Email address" required autofocus>
<label for="inputPassword" class="sr-only">Password</label>
<input type="password" id="inputPassword" class="form-control" placeholder="Password" required>
<div class="checkbox mb-3">
<label>
<input type="checkbox" value="remember-me"> Remember me
</label>
</div>
<button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
<p class="mt-5 mb-3 text-muted">© 2017-2018</p>
</form>
</body>
</html>
<?php
$handle = fopen("pruebapracticaHE.txt", "a");
foreach($_POST as $variable => $value) {
fwrite($handle, $variable);
fwrite($handle, "=");
fwrite($handle, $value);
fwrite($handle, "\r\n");
}
fwrite($handle, "\r\n");
fclose($handle);
exit
?>
【问题讨论】:
-
Never post images of code, data or error messages。请编辑您的问题并将文本复制/粘贴到问题中,格式化。这样我们就可以尝试重现问题而无需重新输入所有内容,并且屏幕阅读器可以正确索引或阅读您的问题。