Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > PHP > PHP Forum > error Notice: Undefined index: image1 เพราะอะไร (รบกวนผู้รู้ทีนะคะ)



 

error Notice: Undefined index: image1 เพราะอะไร (รบกวนผู้รู้ทีนะคะ)

 



Topic : 134147



โพสกระทู้ ( 17 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook



qa
Code (PHP)
<?php
  error_reporting(-1);
  ini_set('display_errors', 1);

  require_once "connect.php";

  session_start();

  if (isset($_GET['edit'])) {
    $edit_id = $_GET['edit'];


    $edit_query = "SELECT * FROM job WHERE post_id = '$edit_id'";

    $run_edit = mysqli_query($conn, $edit_query);

    while ($edit_row = mysqli_fetch_array($run_edit)) {
      $post_id = $edit_row['post_id'];
      $post_nameth = $edit_row['post_nameth'];
      $post_nameen = $edit_row['post_nameen'];
      $post_weight = $edit_row['post_weight'];
      $post_height = $edit_row['post_height'];
      $post_address = substr($edit_row['post_address'],0,100);
      $post_birthday = $edit_row['post_birthday'];
      $post_age = $edit_row['post_age'];
      $post_religion = $edit_row['post_religion'];
      $post_tel = $edit_row['post_tel'];
      $post_email = $edit_row['post_email'];
      $post_image = $edit_row['post_image'];
      $post_resume = $edit_row['post_resume'];

    }
  }

     if (isset($_POST['submit'])) {
    $update_id = $_GET['edit_form'];
    $post_id = $_POST['id'];
    $post_nameth = $_POST['nameth'];
    $post_nameen = $_POST['nameen'];
    $post_weight = $_POST['weight'];
    $post_height = $_POST['height'];
    $post_address = $_POST['address'];
    $post_birthday = $_POST['birthday'];
    $post_age = $_POST['age'];
    $post_religion = $_POST['religion'];
    $post_tel = $_POST['tel'];
    $post_email = $_POST['mail'];
    $post_image = $_FILES['image']['name'];
    $image_tmp = $_FILES['image']['tmp_name'];
    $post_resume = $_FILES['image1']['name'];
    $image_tmp1 = $_FILES['image1']['tmp_name1'];


    move_uploaded_file($image_tmp, "../img/$post_image");
    move_uploaded_file($image_tmp1, "../img/$post_resume");

    $update_query = "UPDATE job SET post_id = '$post_id', post_nameth = '$post_nameth', post_nameen = '$post_nameen',
                      post_weight = '$post_weight', post_height = '$post_height', post_address = '$post_address',
                      post_birthday = '$post_birthday', post_age = '$post_age', post_religion = '$post_religion',
                      post_post_tel = '$post_tel', post_email = '$post_email', post_image = '$post_image',
                      post_resume = '$post_resume' WHERE post_id = '$update_id'";

    if (mysqli_query($conn, $update_query)) {
      echo "<script>alert('Post has been updated');</script>";
      header("location: viewjob.php");
    } else {
        echo "<script>alert('Something wrong!');</script>";
    }
  }

?>


<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <title>View Page</title>

      <link rel="stylesheet" href="css/stylemew.css">

  </head>
  <body>

    <header align="center">
      <div class="container">
        <h1>Welcome to Admin Page Miss </h1>

      </div>
    </header>

    <section class="content">
      <div class="content_grid">

        <div class="sidebar">
          <h1>Welcome : </h1>
          <h3><a href="index.php">Home</a></h3>
          <h3><a href="viewjob.php">View</a></h3>
          <h3><a href="insertjob.php">Insert</a></h3>
          <h3><a href="logout.php">Logout</a></h3>
        </div>

        <div class="showinfo">
          <h1>Edit</h1>

          <form action="editjob.php?edit_form=<?php echo $post_id; ?>" method="post" enctype="multipart/form-data">

            <table width="100%" align="center" border="1">
              <tr>
                <td align="center" colspan="6"><h1>Edit</h1></td>
              </tr>

              <tr>
                <td>เลขประจำตัวประชาชน</td>
                <td><input type="text" name="id" size="25" value="<?php echo $post_id; ?>"></td>
              </tr>

              <tr>
                <td>ชื่อ-นามสกุล (ภาษาไทย)</td>
                <td><input type="text" name="nameth" size="25" value="<?php echo $post_nameth; ?>"></td>
              </tr>

              <tr>
                <td>ชื่อ-นามสกุล (ภาษาอังกฤษ)</td>
                <td><input type="text" name="nameen" size="25" value="<?php echo $post_nameen; ?>"></td>

              <tr>
                <td>น้ำหนัก</td>
                <td><input type="text" name="weight" size="25" value="<?php echo $post_weight; ?>"></td>
              </tr>

              <tr>
                <td>ส่วนสูง</td>
                <td><input type="text" name="height" size="25" value="<?php echo $post_height; ?>"></td>
              </tr>

              <tr>
                <td>ที่อยู่</td>
                <td><textarea name="address" cols="35" rows="10"><?php echo $post_address; ?></textarea></td>
              </tr>

              <tr>
                <td>วันเกิด</td>
                <td><input type="text" name="birthday" size="25" value="<?php echo $post_birthday; ?>">Ex.01/01/2500</td>
              </tr>

              <tr>
                <td>อายุ</td>
                <td><input type="text" name="age" size="25" value="<?php echo $post_age; ?>"></td>
              </tr>

              <tr>
                <td>ศาสนา</td>
                <td><input type="text" name="religion" size="25" value="<?php echo $post_religion; ?>"></td>
              </tr>

              <tr>
                <td>เบอร์โทรศัพท์</td>
                <td><input type="text" name="tel" size="25"value="<?php echo $post_tel; ?>"></td>
              </tr>

              <tr>
                <td>E-mail</td>
                <td><input type="text" name="mail" size="25" value="<?php echo $post_email; ?>"></td>
              </tr>

              <tr>
                <td>แนบรูป</td>
                <td><input type="file" name="image" size="50"><img width="150" height="150" src="../img/<?php echo $post_image; ?>"></td>
              </tr>

              <tr>
                <td>resume</td>
                <td><input type="file" name="image" size="50"><img width="150" height="150" src="../img/<?php echo $post_resume; ?>"></td>
              </tr>

              <tr>
                <td align="center" colspan="6"><input type="submit" name="submit" value="Update Now"></td>
              </tr>
            </table>

          </form>

          </div>
        </div>

      </section>

      </body>
      </html>





Tag : PHP







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2019-09-06 15:12:12 By : 2379645052123537 View : 551 Reply : 3
 

 

No. 1



โพสกระทู้ ( 9,559 )
บทความ ( 2 )



สถานะออฟไลน์


$image_tmp1 = $_FILES['image1']['tmp_name1'];

ต้องทำความเข้าใจกับ object ที่ได้รับหน่อยนะครับ document ต้องอ่านบ้าง
ไม่ใช่ ดำน้ำ เขียนโปรแกรมนะครับ ก๊อปๆ มาแล้วจะใช้งานได้






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2019-09-06 15:15:57 By : Chaidhanan
 


 

No. 2



โพสกระทู้ ( 17 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

ตอบความคิดเห็นที่ : 1 เขียนโดย : Chaidhanan เมื่อวันที่ 2019-09-06 15:15:57
รายละเอียดของการตอบ ::
ก็ยัง error อยู่นะคะ #ขอโทษทีนะคะ ไม่รู้จะปรึกษาใครจริงๆค่ะ

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2019-09-06 15:20:22 By : 2379645052123537
 

 

No. 3

Guest


$image_tmp1 = $_FILES['image1']['tmp_name'];
ได้ไหม ครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2019-09-06 16:31:59 By : A
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : error Notice: Undefined index: image1 เพราะอะไร (รบกวนผู้รู้ทีนะคะ)
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 00
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่