php+html简单表单提交内容到数据库
2020-11-15学无止境南夏1024°c
A+ A-<html> <head> <meta charset="utf-8">//编码 <title>标题</title> <form action="" method="post"><input type="text" name="link" style="width:545px;height:35px"/><hr><input type="submit" name="submit" value="提交bai" style="width:545px;height:35px"/></form> </html> <?php $nanxia = $_POST['link']; if(strlen($nanxia) >5){ $conn = new mysqli('数据库地址','用户名','密码','数据库'); $sql = "INSERT INTO nanxia_WeChat (link) VALUES ('$nanxia')"; $conn->query($sql); $conn->close(); echo "提交成功"; } else{ echo "尚未提交任何内容"; } ?>
未定义标签