|
|
|
ช่วยทีครับอัฟไฟภาพ php ขึ้นเออเร่อแบบนี้แก้ยังไงครับ |
|
|
|
|
|
|
|
อีกหน้าหนึ่งทำได้พอสร้างหน้าใหม่ทำไม่ได้
Code (PHP)
<?php
session_start();
if(isset($_REQUEST['submit'])){
//connection
include("connect_db.php");
//รับค่า user & password
$Username = $_REQUEST['Username'];
$Password = $_REQUEST['Password'];
$Fname = $_REQUEST['Fname'];
$Lname = $_REQUEST['Lname'];
$Type = $_REQUEST['Type'];
$Status = $_REQUEST['Status'];
$hbd = $_REQUEST['hbd'];
$Class = $_REQUEST['Class'];
$Sex = $_REQUEST['Sex'];
$ext = PATHINFO(basename($_FILES['pro_img']['name']),PATHINFO_EXTENSION);
$new_image_name = 'newimg_'.uniqid().".".$ext;
$image_path = "./img1/";
$upload_path = $image_path.$new_image_name;
$success = move_uploaded_file($_FILES['pro_img']['tmp_name'],$upload_path);
if($success==FALSE){
echo 'เจ้ง';
exit();
}
$sq2="insert into tbl_member(member_username,member_password,member_fname,member_lname,member_type,member_status,member_hbd,member_class,member_sex,pro_img"
. ") values('$Username','$Password','$Fname','$Lname','$Type','$Status','$hbd','$Class','$Sex','$new_image_name') ";
$sq1="insert into tbl_p(people_member) values('$Username') ";
$result = mysqli_query($con,$sq2);
$result1 = mysqli_query($con,$sq1);
if ($result&&$result1){
echo "<script type='text/javascript'>";
echo "alert('เพิ่มข่าวเรียบร้อย');";
echo "window.location='register_show.php';";
echo "</script>";
} else {
echo "เกิดข้อผิดพลาด หรือ ข้อมูลนี้มีอยู่แล้ว". mysqli_connect_error($con) ;
}
mysqli_close($con);
}
?>
Tag : PHP
|
|
|
|
|
|
Date :
2019-11-26 14:56:33 |
By :
anzer112 |
View :
602 |
Reply :
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
เอา code ส่วน form upload มาแปะด้วยครับ
|
|
|
|
|
Date :
2019-11-26 16:32:58 |
By :
Manussawin |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SELECT * FROM tablename WHERE member_status = 'S' AND member_class LIKE '%ป.1/3%'
|
|
|
|
|
Date :
2019-11-26 17:26:29 |
By :
Plukza |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 00
|