【发布时间】:2017-02-27 12:21:25
【问题描述】:
<html>
<head>
<title> Futja e te dhenave nepermjet nje forme </title>
<style type = "text/css">
body { background-color: #cfd0f9 }
h2 { font-family: arial, sans-serif;
color: blue }
h3 {font-color: yellow}
.error {color: #FF0000;}
</style>
</head>
<body>
<h1><center>please enter data</center></h1>
<p> <span class="error">* please fill these fields.</span> </p>
<form method="post" action="insert.php">
<strong> Emri:          </strong> <input type="text" name="fname" />
<span class="error">* <?php echo $fnameErr;?></span>
<br>
<strong> Mbiemri:    </strong> <input type="text" name="lname" />
<span class="error">* <?php echo $dtlErr;?></span>
<br>
<input type="submit" name= "shto" value="Add"/>
</form>
</body>
</html>
我们的班主任提供了一个关于如何将 html 页面与数据库连接的项目。
但是我正在到处搜索教程,但是我在哪里看到他们在 php 的帮助下连接 html? 那么,我可以在不使用数据库中的 php 的情况下连接 html 页面吗?如何?
【问题讨论】:
-
HTML 是专门的标记语言,usimg html 可以通过 css 和 javascript 呈现您的网站。您无法使用 HTML 连接到 mysql。
-
不,你不能。你需要一个像php这样的后端工具
-
html 是一个前端工具(一切都在客户端执行),如果您可以在客户端连接到数据库,那么您的数据库就会变得易受攻击。这就是为什么你需要一个像php这样的后端工具来连接到服务器端的db
-
您可以通过阅读本文找到完整的答案。 stackoverflow.com/questions/5012335/…
-
您可以通过阅读本文找到完整的答案。 stackoverflow.com/questions/5012335/…