php insert.php

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php insert.php相关的知识,希望对你有一定的参考价值。

<?php
include "config.php";

if(isset['submit']) {
	
$name = $_post['name'];
$mail = $_post['mail'];
$password = $_post['password'];
$passconfirm = $_post['passconfirm'];

$sql = insert * into admin (name, email, pass, passconfirm) value ('name', 'mail', 'password', 'passconfirm');
$query = ($db, $sql);

if ($query)
(header location:?index.php=sukses)
else
(header location:?index.php=try again)
else
die("no direct access")

}


?>

以上是关于php insert.php的主要内容,如果未能解决你的问题,请参考以下文章

为啥这个 PHP 脚本不会在 MySQL 数据库中插入表单数据?

如何发布禁用的输入

php表单提交后返回页面

PHP表单以数组作为行提交

将 jQuery 数组传递给 PHP (POST)

将变量值从 JS 传递给 PHP