",$page); ?> .
Academic Staff Expertise |
Institute/School | Areas of Expertise | |
echo $arr['firstname'] ?> echo $arr['lastname'] ?> |
Institute: echo $arr['institute'] ?> School: echo $arr['school'] ?> |
1. echo $arr['expertise1'] ?> |
include_once "connDB.php"; ?> // Convert Variable Array To Variable แก้ไขปัญหาการไม่อ่านค่าที่ส่ง while(list($xVarName, $xVarvalue) = each($_GET)) { ${$xVarName} = $xVarvalue; } while(list($xVarName, $xVarvalue) = each($_POST)) { ${$xVarName} = $xVarvalue; } while(list($xVarName, $xVarvalue) = each($_FILES)) { ${$xVarName."_name"} = $xVarvalue['name']; ${$xVarName."_type"} = $xVarvalue['type']; ${$xVarName."_size"} = $xVarvalue['size']; ${$xVarName."_error"} = $xVarvalue['error']; ${$xVarName} = $xVarvalue['tmp_name']; } ?> if($submit=="OK"){ if ($_FILES['upload_file']['name']!= '') { $path='file_upload/'; $file=$_FILES['upload_file']['name']; $file_type= strrchr( $file , '.' ); $pic_name='upload_file_'.$id.strtoupper($file_type); copy ($_FILES['upload_file']['tmp_name'],$path.$pic_name); $upload_file=$pic_name; } if ($_FILES['upload_file1']['name']!= '') { $path='picture_upload/'; $file=$_FILES['upload_file1']['name']; $file_type= strrchr( $file , '.' ); $pic_name='upload_file1_'.$id.strtoupper($file_type); copy ($_FILES['upload_file1']['tmp_name'],$path.$pic_name); $upload_file1=$pic_name; } if($id1==""){ $sql="INSERT INTO expertise set id='".$id."',prefix='".$prefix."',firstname='".$firstname."',lastname='".$lastname."',institute='".$institute."',school='".$school."',tel='".$tel."',email='".$email."',expertise1='".$expertise1."',expertise2='".$expertise2."',expertise3='".$expertise3."',expertise4='".$expertise4."',expertise5='".$expertise5."',daterecord='".$daterecord."',upload_file='".$upload_file."',upload_file1='".$upload_file1."'"; }else{ $sql="UPDATE expertise set prefix='".$prefix."',firstname='".$firstname."',lastname='".$lastname."',institute='".$institute."',school='".$school."',tel='".$tel."',email='".$email."',expertise1='".$expertise1."',expertise2='".$expertise2."',expertise3='".$expertise3."',expertise4='".$expertise4."',expertise5='".$expertise5."',daterecord='".$daterecord."',upload_file='".$upload_file."',upload_file1='".$upload_file1."' WHERE id='".$id1."'" ; } mysql_query($sql); } if ($submit=="DEL"){ $sql="select * from expertise where id='".$id1."' "; $rstTemp=mysql_query($sql); $file_tmp=mysql_result($rstTemp,0,'upload_file'); if($file_tmp!='') unlink('file_upload/'.$file_tmp); $file_tmp=mysql_result($rstTemp,0,'upload_file1'); if($file_tmp!='') unlink('picture_upload/'.$file_tmp); $sql="delete from expertise where id ='".$id1."'"; mysql_query($sql); } ?>
Academic Staff Expertise |
Institute/School | Areas of Expertise | |
echo $arr['firstname'] ?> echo $arr['lastname'] ?> |
Institute: echo $arr['institute'] ?> School: echo $arr['school'] ?> |
1. echo $arr['expertise1'] ?> |