มันขึ้นว่า Warning: Undefined array key "id_account" in D:\xampp\htdocs\project\src\chang.php on line 3 ครับคือผมต้องแก้ตรงไหนครับ
นั่งแก้มาหลายชั่วโมงแล้วครับ แทบจะร้องไห้ หัวร้อน ด้วยครับ วอนผู้รู้ ช่วยผมที
<?php
require('dbconnect.php');
$id_account = $_GET['id_account'];
$sql = "SELECT * FROM account WHERE id_account = '$id_account'";
$result = mysqli_query($con, $sql);
$row = mysqli_fetch_assoc($result);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>แก้ไขข้อมูลสมาชิก</title>
<link href="./output.css" rel="stylesheet">
<link rel="stylesheet" href="
https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<style>
.btn-animate {
transition: all 0.3s ease-in-out;
}
.btn-animate:hover {
transform: translateY(-2px);
}
.btn-animate:active {
transform: translateY(0);
box-shadow: none;
}
</style>
</head>
<body>
<div class=" bg-cover h-screen bg-center " style="background-image: url('/images/bg.png'); ">
<div class="flex h-screen">
<!-- Sidebar -->
<div class="w-1/5 bg-gray-800 text-white p-4 flex flex-col ">
<ul class="flex-grow">
<li class="mt-8">
<a href="main.html" class="btn-animate flex text-white-300 hover:text-red-500">
<span class="text-4xl font-bold">หน้าหลัก</span>
</a>
</li>
<li class="my-6">
<a href="changeprofile.html"
class="btn-animate flex items-center text-white-300 hover:text-red-500">
<img src="/images/address-card-regular (1).svg" alt="icon" class="w-7 h-7 mr-4 ">
<span>แก้ไขข้อมูลสมาชิก</span>
</a>
</li>
<li class="my-5">
<a href="history-page1.html"
class="btn-animate flex items-center text-white-300 hover:text-red-500">
<img src="/images/clock-regular (1).svg" alt="icon" class="w-7 h-7 mr-4 ">
<span>ประวัติการยืม-คืนทั้งหมด</span>
</a>
</li>
</ul>
<ul class="mt-auto">
<li>
<a href="Login.html" class="btn-animate flex items-center text-white-300 hover:text-red-500 ">
<img src="/images/power-off-solid (1).svg" alt="icon" class="w-7 h-7 mr-4 ">
<span>ออกจากระบบ</span>
</a>
</li>
</ul>
</div>
<!-- Main content -->
<div class="w-3/4 p-10 bg-cover bg-center" style="background-image: url('/mnt/data/image.png');">
<div class="bg-white shadow-md p-4 mb-3">
<h1 class="text-2xl font-bold">แก้ไขข้อมูลสมาชิก</h1>
</div>
<div class="max-w-md mx-auto bg-white p-8 rounded-lg shadow-md">
<div class="mb-4 text-center">
<img class="w-28 h-28 rounded-full mx-auto" src="
https://via.placeholder.com/150"
alt="Profile Picture">
<button
class="mt-5 px-4 py-2 text-white rounded-full bg-gradient-to-r from-sky-400 to-blue-500 hover:from-sky-600 hover:to-blue-700 btn-animate">อัปโหลดใหม่</button>
</div>
<form id="#">
<div class="mb-4">
<label class="block text-gray-700 text-sm font-bold mb-2" for="name">
ชื่อ-นามสกุล
</label>
<input
class="btn-animate shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline focus:ring-2 focus:ring-sky-300"
id="name" type="text" placeholder="ชื่อ-นามสกุล">
</div>
<div class="mb-4">
<label class="block text-gray-700 text-sm font-bold mb-2" for="class">
ชั้นปี
</label>
<input
class="btn-animate shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline focus:ring-2 focus:ring-sky-300"
id="class" type="text" placeholder="ชั้นปี">
</div>
<div class="mb-4">
<label class="block text-gray-700 text-sm font-bold mb-2" for="studentId">
รหัสประจำตัวนักศึกษา
</label>
<input
class="btn-animate shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline focus:ring-2 focus:ring-sky-300"
id="studentId" type="text" placeholder="รหัสประจำตัวนักศึกษา">
</div>
<a href="main.html">
<div class="flex items-center justify-between">
<img src="/images/save.svg" alt="icon" class="w-7 h-7 mr-2 ">
<button
class="bg-gradient-to-r from-sky-400 to-blue-500 hover:from-sky-600 hover:to-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline btn-animate"
type="button" onclick="submitForm()">
บันทึก
</button>
</div>
</a>
</form>
</div>
</div>
</div>
</div>
</body>
</html>
ช่วยด้วยครับ ติด Warning PHP
นั่งแก้มาหลายชั่วโมงแล้วครับ แทบจะร้องไห้ หัวร้อน ด้วยครับ วอนผู้รู้ ช่วยผมที
<?php
require('dbconnect.php');
$id_account = $_GET['id_account'];
$sql = "SELECT * FROM account WHERE id_account = '$id_account'";
$result = mysqli_query($con, $sql);
$row = mysqli_fetch_assoc($result);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>แก้ไขข้อมูลสมาชิก</title>
<link href="./output.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<style>
.btn-animate {
transition: all 0.3s ease-in-out;
}
.btn-animate:hover {
transform: translateY(-2px);
}
.btn-animate:active {
transform: translateY(0);
box-shadow: none;
}
</style>
</head>
<body>
<div class=" bg-cover h-screen bg-center " style="background-image: url('/images/bg.png'); ">
<div class="flex h-screen">
<!-- Sidebar -->
<div class="w-1/5 bg-gray-800 text-white p-4 flex flex-col ">
<ul class="flex-grow">
<li class="mt-8">
<a href="main.html" class="btn-animate flex text-white-300 hover:text-red-500">
<span class="text-4xl font-bold">หน้าหลัก</span>
</a>
</li>
<li class="my-6">
<a href="changeprofile.html"
class="btn-animate flex items-center text-white-300 hover:text-red-500">
<img src="/images/address-card-regular (1).svg" alt="icon" class="w-7 h-7 mr-4 ">
<span>แก้ไขข้อมูลสมาชิก</span>
</a>
</li>
<li class="my-5">
<a href="history-page1.html"
class="btn-animate flex items-center text-white-300 hover:text-red-500">
<img src="/images/clock-regular (1).svg" alt="icon" class="w-7 h-7 mr-4 ">
<span>ประวัติการยืม-คืนทั้งหมด</span>
</a>
</li>
</ul>
<ul class="mt-auto">
<li>
<a href="Login.html" class="btn-animate flex items-center text-white-300 hover:text-red-500 ">
<img src="/images/power-off-solid (1).svg" alt="icon" class="w-7 h-7 mr-4 ">
<span>ออกจากระบบ</span>
</a>
</li>
</ul>
</div>
<!-- Main content -->
<div class="w-3/4 p-10 bg-cover bg-center" style="background-image: url('/mnt/data/image.png');">
<div class="bg-white shadow-md p-4 mb-3">
<h1 class="text-2xl font-bold">แก้ไขข้อมูลสมาชิก</h1>
</div>
<div class="max-w-md mx-auto bg-white p-8 rounded-lg shadow-md">
<div class="mb-4 text-center">
<img class="w-28 h-28 rounded-full mx-auto" src="https://via.placeholder.com/150"
alt="Profile Picture">
<button
class="mt-5 px-4 py-2 text-white rounded-full bg-gradient-to-r from-sky-400 to-blue-500 hover:from-sky-600 hover:to-blue-700 btn-animate">อัปโหลดใหม่</button>
</div>
<form id="#">
<div class="mb-4">
<label class="block text-gray-700 text-sm font-bold mb-2" for="name">
ชื่อ-นามสกุล
</label>
<input
class="btn-animate shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline focus:ring-2 focus:ring-sky-300"
id="name" type="text" placeholder="ชื่อ-นามสกุล">
</div>
<div class="mb-4">
<label class="block text-gray-700 text-sm font-bold mb-2" for="class">
ชั้นปี
</label>
<input
class="btn-animate shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline focus:ring-2 focus:ring-sky-300"
id="class" type="text" placeholder="ชั้นปี">
</div>
<div class="mb-4">
<label class="block text-gray-700 text-sm font-bold mb-2" for="studentId">
รหัสประจำตัวนักศึกษา
</label>
<input
class="btn-animate shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline focus:ring-2 focus:ring-sky-300"
id="studentId" type="text" placeholder="รหัสประจำตัวนักศึกษา">
</div>
<a href="main.html">
<div class="flex items-center justify-between">
<img src="/images/save.svg" alt="icon" class="w-7 h-7 mr-2 ">
<button
class="bg-gradient-to-r from-sky-400 to-blue-500 hover:from-sky-600 hover:to-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline btn-animate"
type="button" onclick="submitForm()">
บันทึก
</button>
</div>
</a>
</form>
</div>
</div>
</div>
</div>
</body>
</html>