Page de réponse du forum de développement PHP
La dernière introduction à la fonction de réponse :
<?php
session_start();
header("content-type:text/html;charset=utf-8");
//连接数据库
$link = mysqli_connect("localhost","root","root","message");
mysqli_set_charset($link,"utf8");
if (!$link) {
die("连接失败: " . mysqli_connect_error());
}
$id = isset($_GET['id'])?$_GET['id']:"";
$reply = isset($_POST['reply'])?$_POST['reply']:"";
$sql ="update details set reply='$reply' where id=".$id;
$rel = mysqli_query($link,$sql);
if($rel){
echo"回复成功"."<br/><br/>";
echo"<a href='list.php'>跳转至留言列表页面</a>";
}else{
echo"回复失败"."<br/><br/>";
echo"<a href='reply.html'>跳转至回复编辑页面</a>";
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="format-detection" content="telephone=no" />
<title>回复页面</title>
<style>
.w410{
width: 410px;
}
.fon_f{
font-family: 微软雅黑;
}
.pt{
padding-top: 80px;
}
</style>
</head>
<body>
<div style="margin: 0 auto;" class="fon_f w410">
<div>
<h1 style= "text-align:center;">留言窗口</h1>
</div>
<div style="margin: 0 auto;" class="pt lh">
<form name="form1" method="post" action="reply.php?id=<?php echo $_GET['id']?>">
回复:<textarea style="width: 380px;height: 200px;" name="reply"></textarea><br/><br/>
<input type="submit" value="确认回复">
</form>
</div>
</div>
</body>
</html>
nouveau fichier
<?php
session_start();
header("content-type:text/html;charset=utf-8");
//连接数据库
$link = mysqli_connect("localhost","root","root","message");
mysqli_set_charset($link,"utf8");
if (!$link) {
die("连接失败: " . mysqli_connect_error());
}
$id = isset($_GET['id'])?$_GET['id']:"";
$reply = isset($_POST['reply'])?$_POST['reply']:"";
$sql ="update details set reply='$reply' where id=".$id;
$rel = mysqli_query($link,$sql);
if($rel){
echo"回复成功"."<br/><br/>";
echo"<a href='list.php'>跳转至留言列表页面</a>";
}else{
echo"回复失败"."<br/><br/>";
echo"<a href='reply.html'>跳转至回复编辑页面</a>";
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="format-detection" content="telephone=no" />
<title>回复页面</title>
<style>
.w410{
width: 410px;
}
.fon_f{
font-family: 微软雅黑;
}
.pt{
padding-top: 80px;
}
</style>
</head>
<body>
<div style="margin: 0 auto;" class="fon_f w410">
<div>
<h1 style= "text-align:center;">留言窗口</h1>
</div>
<div style="margin: 0 auto;" class="pt lh">
<form name="form1" method="post" action="reply.php?id=<?php echo $_GET['id']?>">
回复:<textarea style="width: 380px;height: 200px;" name="reply"></textarea><br/><br/>
<input type="submit" value="确认回复">
</form>
</div>
</div>
</body>
</html>
Aperçu
Clear
- Recommandations de cours
- Téléchargement du didacticiel
Le didacticiel n'est pas disponible au téléchargement pour le moment. Le staff est actuellement en train de l'organiser. Veuillez prêter plus d'attention à ce cours à l'avenir ~
Les étudiants qui ont regardé ce cours apprennent également
Parlons brièvement de la création d'une entreprise en PHP
Introduction rapide au développement web front-end
Développement pratique à grande échelle par Tianlongbabu du cadre MVC version Mini imitant le site Web de l'encyclopédie des choses embarrassantes
Premiers pas avec le développement pratique PHP : création rapide de PHP [Small Business Forum]
Vérification de connexion et forum de discussion classique
Collecte de connaissances sur les réseaux informatiques
Démarrage rapide de la version complète de Node.JS
Le cours front-end qui vous comprend le mieux : HTML5/CSS3/ES6/NPM/Vue/...[Original]
Écrivez votre propre framework PHP MVC (40 chapitres en profondeur/gros détails/à lire absolument pour que les débutants progressent)
















