|
|
|
รบกวนดูไฟล์อัปโหลดให้ผมหน่อย ครับ อัปโหลดได้แล้ว แต่ติดตรงเวลาแก้ไข ไฟล์อัปโหลด |
|
|
|
|
|
|
|
ไฟล์อัปโหลด
Code (PHP)
<?php
include('config.inc.php');
include('fnalert.php');
//include('datetimepicking.php');
$title=$_POST['title'];
$title_detail=$_POST['title_detail'];
$title_date=$_POST['title_date'];
global $HTTP_POST_FILES;
$realname = $HTTP_POST_FILES['userfile']['name'];
if (is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name']))
$size = getimagesize($HTTP_POST_FILES['userfile']['tmp_name']);
$size[620]; // width
$size[339]; // height
{
move_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'],"immage_title/$realname");
echo "Upload Filename:".$HTTP_POST_FILES['userfile']['name'];
}
$sql="insert into title (id_title,title,title_detail,file,title_date) VALUES ('','$title','$title_detail','$realname','$title_date')";
$result=mysql_query($sql);
if($result){
mysql_query("COMMIT");
al("success!!");
redi3("add_title.php");
}else{
echo mysql_error();
mysql_query("ROLLBACK");
al("not success!!");
redi3("javascript:history:back();");
}
?>
ไฟล์ที่ต้องการแก้ไขที่อัปโหลดไปแล้ว
Code (PHP)
<?php
include("config.inc.php");
include('fnalert.php');
$idproject=$_GET['idproject'];
$project_name=$_POST['project_name'];
$project_name_1=$_POST['project_name_1'];
$project_contact=$_POST['project_contact'];
$project_tel=$_POST['project_tel'];
$project_email=$_POST['project_email'];
global $HTTP_POST_FILES;
$realname = $HTTP_POST_FILES['userfile']['name'];
if (is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name']))
{
copy($HTTP_POST_FILES['userfile']['tmp_name'],"upload_map/$realname");
echo "Upload Filename: " . $HTTP_POST_FILES['userfile']['name'];
}
$ssq="UPDATE project SET project_name='$project_name', project_name_1='$project_name_1' , project_contact='$project_contact' , project_tel='$project_tel', project_email='$project_email' ,file='$realname' where idproject='$idproject'";
$result=mysql_query($ssq);
if($result){
mysql_query("COMMIT");
al("edit success!!");
redi3("add_project_show.php");
}else{
echo mysql_error();
mysql_query("ROLLBACK");
al("not success!!");
redi3("javascript:history:back();");
}
?>
Tag : PHP, HTML/CSS, JavaScript
|
|
|
|
|
|
Date :
2013-06-19 17:02:22 |
By :
Max |
View :
788 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
** ขอแก้ ครับ ใส่ผิด ( ไฟล์ที่ต้องการแก้ไขที่อัปโหลดไปแล้ว )
Code (PHP)
<?php
include('config.inc.php');
include('fnalert.php');
include('datetimepicking.php');
$id_title=$_GET['id_title'];
$title=$_POST['title'];
$title_detail=$_POST['title_detail'];
$title_date=$_POST['title_date'];
global $HTTP_POST_FILES;
$realname_in = $HTTP_POST_FILES['userfile']['name'];
if (is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name']))
$size = getimagesize($HTTP_POST_FILES['userfile']['tmp_name']);
$size[620]; // width
$size[339]; // height
{
move_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'],"immage_title/$realname_in");
echo "Upload Filename:".$HTTP_POST_FILES['userfile']['name'];
}
$aaa="UPDATE title SET title='$title', title_detail='$title_detail', file='$realname_in' , title_date='$title_date'
WHERE id_title='$id_title'";
$result=mysql_query($aaa);
if($result){
mysql_query("COMMIT");
al("Edit success!!");
redi3("managment.php?Page=$Page");
}else{
echo mysql_error();
mysql_query("ROLLBACK");
al("not success!!");
redi3("javascript:history:back();");
}
?>
|
|
|
|
|
Date :
2013-06-19 17:05:21 |
By :
Max |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 00
|