|
 |
|
พี่ค่ะช่วยดูให้หน่อย ภาพไม่ลงfolder images ค่ะ เปลี่ยนโหมดเป็น 777แล้ว |
|
 |
|
|
 |
 |
|
พี่ค่ะช่วยดูให้หน่อย ภาพไม่ลงfolder images ค่ะ เปลี่ยนโหมดเป็น 777 แล้ว ลงแต่ชื่ิอในdatabase
ขึ้นข้อความนี้ค่ะ
Notice: Undefined variable: adminPicture in /usr/home/56dsuavmrtosvc/public_html/admin/insert_admin.php on line 23
insert_admin.php ()
<meta http-equiv="Content-Type" content="text/html; charset=tis-620" />
<?php
include("config.php");
$adminID=$_REQUEST["adminID"];
$prenameID=$_REQUEST["prenameID"];
$adminName=$_REQUEST["adminName"];
$adminSurname=$_REQUEST["adminSurname"];
$positionID=$_REQUEST["positionID"];
$adminPassword=$_REQUEST["adminPassword"];
$adminRepass=$_REQUEST["adminRepass"];
$filename=$_FILES['adminPicture']['name'];
$ff = strrchr($filename,".");
$upfilename = strftime("%S%M%H").time().$ff;
if ($filename == "" )
{
$sql="INSERT INTO admin(adminID,prenameID,adminName,adminSurname,positionID,adminPassword,adminRepass,adminPicture)";
$sql.="VALUES ('$adminID','$prenameID','$adminName','$adminSurname','$positionID','$adminPassword','$adminRepass','-')";
}
else
{
copy($adminPicture,"images/$upfilename");
$sql="INSERT INTO admin(adminID,prenameID,adminName,adminSurname,positionID,adminPassword,adminRepass,adminPicture)";
$sql.="VALUES ('$adminID','$prenameID','$adminName','$adminSurname','$positionID','$adminPassword','$adminRepass','$upfilename')";
}
mysql_query($sql,$conn)
or die("ไม่สามารถเพิ่มข้อมูลลงสู่ตาราง admin ได้".mysql_error());
//echo "การเพิ่มข้อมูลสมบูรณ์";
mysql_close($conn);
echo "<meta http-equiv=\"refresh\" content=\"10;URL=showadmin.php\">";
?>
Tag : PHP

|
|
 |
 |
 |
 |
Date :
2014-01-31 16:23:18 |
By :
june_191 |
View :
622 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ระบบมันบอกว่าคุณยังไม่ระบุค่าตัวแปรให้กับตัวแปรชื่อ $adminPicture ไม่ได้เกี่ยวกับโฟล์เดอร์ที่จัดเก็บเลย
ลองดู
Code (PHP)
<meta http-equiv="Content-Type" content="text/html; charset=tis-620" />
<?php
include("config.php");
$adminID=$_REQUEST["adminID"];
$prenameID=$_REQUEST["prenameID"];
$adminName=$_REQUEST["adminName"];
$adminSurname=$_REQUEST["adminSurname"];
$positionID=$_REQUEST["positionID"];
$adminPassword=$_REQUEST["adminPassword"];
$adminRepass=$_REQUEST["adminRepass"];
$filename=$_FILES['adminPicture']['name'];
$adminPicture = $_FILES['adminPicture']['tmp_name'];
$ff = strrchr($filename,".");
$upfilename = strftime("%S%M%H").time().$ff;
if ($filename == "" )
{
$sql="INSERT INTO admin(adminID,prenameID,adminName,adminSurname,positionID,adminPassword,adminRepass,adminPicture)";
$sql.="VALUES ('$adminID','$prenameID','$adminName','$adminSurname','$positionID','$adminPassword','$adminRepass','-')";
}
else
{
copy($adminPicture,"images/$upfilename");
$sql="INSERT INTO admin(adminID,prenameID,adminName,adminSurname,positionID,adminPassword,adminRepass,adminPicture)";
$sql.="VALUES ('$adminID','$prenameID','$adminName','$adminSurname','$positionID','$adminPassword','$adminRepass','$upfilename')";
}
mysql_query($sql,$conn)
or die("ไม่สามารถเพิ่มข้อมูลลงสู่ตาราง admin ได้".mysql_error());
//echo "การเพิ่มข้อมูลสมบูรณ์";
mysql_close($conn);
echo "<meta http-equiv=\"refresh\" content=\"10;URL=showadmin.php\">";
?>
|
ประวัติการแก้ไข 2014-01-31 16:30:08
 |
 |
 |
 |
Date :
2014-01-31 16:29:01 |
By :
arm8957 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 00
|