寻找你的缘分,就在这里!
已注册用户
{$user['name']},{$user['age']}岁,{$user['sex']},爱好:{$user['hobby']}";}?>
CSS样式表(style.css):
css
body {font-family: Arial, Helvetica, sans-serif;
}h1 {font-size: 24px;text-align: center;
}h2 {font-size: 18px;text-align: center;
}form {width: 50%;margin: 0 auto;
}label {display: block;margin-bottom: 5px;
}input[type="text"],
input[type="number"],
textarea {width: 100%;padding: 5px;margin-bottom: 5px;
}input[type="radio"] {margin-right: 5px;
}.users {width: 50%;margin: 0 auto;
}.users ul {list-style-type: none;
}PHP代码(submit.php):
php
prepare("INSERT INTO users (name, age, sex, hobby, introduce) VALUES (?, ?, ?, ?, ?)");// 绑定参数
$stmt->bind_param('sisss', $name, $age, $sex, $hobby, $introduce);// 执行SQL语句
$stmt->execute();// 关闭连接
$conn->close();// 跳转到用户列表页面
header('Location: index.php');
?>