commit 4d2d5e2d5e89852c13a80102bbb0f4b8132a0c61
Author: monjack 姓名: 处理后的密码: 姓名: 性别: 选课:
+
+ 籍贯:
";
+} else {
+ echo "创建患者表失败: " . $conn->error . "
";
+}
+
+// 创建医生表
+$sql_doctor = "
+ CREATE TABLE IF NOT EXISTS doctor_90 (
+ doctor_id CHAR(50),
+ doctor_name CHAR(50),
+ doctor_gender CHAR(1),
+ department_id CHAR(50)
+ ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+";
+
+if ($conn->query($sql_doctor) === TRUE) {
+ echo "医生表创建成功!
";
+} else {
+ echo "创建医生表失败: " . $conn->error . "
";
+}
+
+// 创建科室表
+$sql_department = "
+ CREATE TABLE IF NOT EXISTS department_90 (
+ department_id CHAR(50),
+ department_name CHAR(50),
+ department_location CHAR(50)
+ ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+";
+
+if ($conn->query($sql_department) === TRUE) {
+ echo "科室表创建成功!
";
+} else {
+ echo "创建科室表失败: " . $conn->error . "
";
+}
+
+// 创建挂号表
+$sql_register = "
+ CREATE TABLE IF NOT EXISTS register_90 (
+ biz_id CHAR(50),
+ doctor_id CHAR(50),
+ patient_id CHAR(50),
+ register_date INT,
+ fee INT,
+ state CHAR(1)
+ ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+";
+
+if ($conn->query($sql_register) === TRUE) {
+ echo "挂号表创建成功!
";
+} else {
+ echo "创建挂号表失败: " . $conn->error . "
";
+}
+
+// 插入测试数据
+$sql_insert = "
+ INSERT IGNORE INTO patient_90 (patient_id, patient_name, patient_gender, patient_address) VALUES
+ ('510103001', '张三', '1', '成都'),
+ ('510103002', '李四', '2', '重庆');
+
+ INSERT IGNORE INTO doctor_90 (doctor_id, doctor_name, doctor_gender, department_id) VALUES
+ ('510105001', '王医生', '2', '001'),
+ ('510105002', '罗医生', '1', '002'),
+ ('510105003', '陈医生', '1', '001');
+
+ INSERT IGNORE INTO department_90 (department_id, department_name, department_location) VALUES
+ ('001', '内科', '1楼2诊室'),
+ ('002', '外科', '1楼5诊室');
+";
+
+if ($conn->multi_query($sql_insert) === TRUE) {
+ echo "测试数据插入成功!
";
+} else {
+ echo "插入测试数据失败: " . $conn->error . "
";
+}
+
+// 关闭数据库连接
+$conn->close();
+?>
diff --git a/db_config.php b/db_config.php
new file mode 100644
index 0000000..95ea00f
--- /dev/null
+++ b/db_config.php
@@ -0,0 +1,7 @@
+
+
+
+
+ 提交结果:
+ 提交结果:
+
+
+
+
diff --git a/login.php b/login.php
new file mode 100644
index 0000000..b8f99a3
--- /dev/null
+++ b/login.php
@@ -0,0 +1,52 @@
+prepare($sql);
+ $stmt->bind_param("ss", $name, $hashedPassword);
+ $stmt->execute();
+ $result = $stmt->get_result();
+
+ if ($result->num_rows > 0) {
+ // 登录成功,设置 Session
+ $_SESSION['s_name'] = $name;
+ header("Location: user_info.php"); // 跳转到 user_info.php
+ exit();
+ } else {
+ // 登录失败
+ echo "用户名或密码错误!";
+ }
+ }
+}
+?>
+
+
+
+
+
+
+
+ num_rows > 0) {
+ $index = $offset + 1; // 起始序号
+ while ($row = $result->fetch_assoc()) {
+ echo "姓名列表
+ ";
+ $index++;
+ }
+ } else {
+ echo "{$index}. {$row['name']} ";
+ }
+ ?>
+ 没有数据
+
+
+ 首页
+ 上一页
+ 下一页
+ 末页
+
+ 患者挂号
+
+
+
+
+
diff --git a/patient_register_list_90.php b/patient_register_list_90.php
new file mode 100644
index 0000000..b2e779a
--- /dev/null
+++ b/patient_register_list_90.php
@@ -0,0 +1,107 @@
+query($sql_query);
+?>
+
+
+
+
+
+ 患者挂号列表
+
+
+
+
+
+
+
+
diff --git a/r_1.php b/r_1.php
new file mode 100644
index 0000000..3207fc5
--- /dev/null
+++ b/r_1.php
@@ -0,0 +1,14 @@
+
diff --git a/r_2.php b/r_2.php
new file mode 100644
index 0000000..270a1e3
--- /dev/null
+++ b/r_2.php
@@ -0,0 +1,9 @@
+
diff --git a/r_3.php b/r_3.php
new file mode 100644
index 0000000..b15933c
--- /dev/null
+++ b/r_3.php
@@ -0,0 +1,8 @@
+connect_error) {
+ die("连接失败: " . $conn->connect_error);
+}
+
+// 检查是否提交表单
+if ($_SERVER["REQUEST_METHOD"] === "POST") {
+ $name = isset($_POST['name']) ? trim($_POST['name']) : '';
+ $password = isset($_POST['password']) ? trim($_POST['password']) : '';
+
+ // 表单验证
+ if (empty($name) || empty($password)) {
+ echo "姓名和密码不能为空!";
+ } else {
+ // 密码加密
+ $hashedPassword = md5($password);
+
+ // 查询是否存在该用户
+ $sql = "SELECT * FROM user_70 WHERE name = ?";
+ $stmt = $conn->prepare($sql);
+ $stmt->bind_param("s", $name);
+ $stmt->execute();
+ $result = $stmt->get_result();
+
+ if ($result->num_rows > 0) {
+ // 用户存在,更新密码
+ $updateSql = "UPDATE user_70 SET password = ? WHERE name = ?";
+ $updateStmt = $conn->prepare($updateSql);
+ $updateStmt->bind_param("ss", $hashedPassword, $name);
+ if ($updateStmt->execute()) {
+ echo "密码更新成功!";
+ } else {
+ echo "密码更新失败:" . $conn->error;
+ }
+ } else {
+ // 用户不存在,插入新用户
+ $insertSql = "INSERT INTO user_70 (name, password) VALUES (?, ?)";
+ $insertStmt = $conn->prepare($insertSql);
+ $insertStmt->bind_param("ss", $name, $hashedPassword);
+ if ($insertStmt->execute()) {
+ echo "注册成功!";
+ } else {
+ echo "注册失败:" . $conn->error;
+ }
+ }
+ }
+}
+
+// 关闭数据库连接
+$conn->close();
+?>
+
+
+
+
+
+
+
+
+
+ num_rows > 0): ?>
+ fetch_assoc()) { ?>
+ 科室
+ 医生
+ 患者
+ 就诊时间
+ 挂号费
+ 操作
+
+
+
+
+
+
+
+
+
+
+ 编辑
+ |
+ 删除
+
+
+
+
+
+暂无数据
+
";
+ if ($result && mysqli_num_rows($result) > 0) {
+ $tableExist = true;
+ }else{
+ $tableExist = false;
+ }
+ if($tableExist){
+ if($table == 'user_70'){
+ $query_string = "select * from user_70";
+ $result = mysqli_query($link,$query_string);
+ echo "
";
+ while($row = mysqli_fetch_array($result)){
+ echo $row['name']."
";
+ echo $row['address']."
";
+ echo $row['password']."
";
+ echo "
";
+ }
+ }
+ else if($table == 'nucleic_acid_test_2'){
+ $query_string = "select * from nucleic_acid_test_2";
+ $result = mysqli_query($link,$query_string);
+ echo "
";
+ while($row = mysqli_fetch_array($result)){
+ echo $row['id']."
";
+ echo $row['name']."
";
+ echo $row['address']."
";
+ echo $row['event_time']."
";
+ echo $row['insert_time']."
";
+ echo $row['code']."
";
+ echo "
";
+ }
+ }
+ else if($table == 'patient_90'){
+ $query_string = "select * from patient_90";
+ $result = mysqli_query($link,$query_string);
+ echo "
";
+ while($row = mysqli_fetch_array($result)){
+ echo $row['patient_id']."
";
+ echo $row['patient_name']."
";
+ echo $row['patient_gender']."
";
+ echo $row['patient_address']."
";
+ echo "
";
+ }
+ }
+
+ }
+}
diff --git a/spider_251_2.php b/spider_251_2.php
new file mode 100644
index 0000000..33c6b8e
--- /dev/null
+++ b/spider_251_2.php
@@ -0,0 +1,38 @@
+ "Missing required parameter: goods"]);
+ exit;
+}
+
+// 定义目标地址
+$target_url = "http://localhost:8022/goods/flash_sale_1.php";
+
+// 使用 cURL 抓取页面内容
+$ch = curl_init();
+curl_setopt($ch, CURLOPT_URL, $target_url);
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+curl_setopt($ch, CURLOPT_TIMEOUT, 10); // 设置超时时间
+$response = curl_exec($ch);
+
+if (curl_errno($ch)) {
+ echo json_encode(["error" => "Failed to fetch the target page"]);
+ curl_close($ch);
+ exit;
+}
+curl_close($ch);
+
+// 使用正则表达式匹配指定商品的价格
+// 根据提供的网页结构,价格在 价格 中
+$pattern = '/(\d+)元<\/span>/';
+if (preg_match($pattern, $response, $matches)) {
+ // 提取并输出价格
+ echo json_encode([(int)$matches[1]]);
+} else {
+ // 如果没有匹配到价格,返回提示信息
+ echo json_encode(["error" => "Price not found for the specified goods"]);
+}
+?>
diff --git a/upload_1.php b/upload_1.php
new file mode 100644
index 0000000..bb78344
--- /dev/null
+++ b/upload_1.php
@@ -0,0 +1,46 @@
+
+
+
+
+
存储路径:{$targetFile}
"; + } else { + echo "文件上传失败,请检查目录权限!
"; + } + } else { + echo "文件上传出错,错误码:" . $file["error"] . "
"; + } +} +?> + + + + + diff --git a/user_info.php b/user_info.php new file mode 100644 index 0000000..80a5dc9 --- /dev/null +++ b/user_info.php @@ -0,0 +1,22 @@ + + + + + + +