 |
เมื่อ Submit จาก form แล้วมาที่หน้า upload.php (code ด้านล่างครับ) IE จะขึ้น Internet Explorer Can not Display เป็นหน้าจอขาวและไม่ redirect ไปที่ page ที่ต้องการ |
|
 |
|
|
 |
 |
|
เมื่อ Submit จาก form แล้วมาที่หน้า upload.php (code ด้านล่างครับ) IE จะขึ้น Internet Explorer Can not Display เป็นหน้าจอขาวและไม่ redirect ไปที่ page ที่ต้องการ
แต่ว่า สามารถเพิ่มข้อมูลลงฐานข้อมูลได้หมดครับ
Code (PHP)
<?php
ob_start();
session_start();
include "../system/regisglobal.php";
include "../system/DB_config.php";
include "../system/DB_class.php";
include "../system/class_utilDB.php";
include "../system/class_util.php";
// อินสแต๊นของคลาส
$clsutilDB = new utilDB(HOST,USER,PASS,DB);
$clsutilDB->MYSQLS_CONNECTS();
// อินสแต๊นของคลาส
$clsUtil = new utility();
$Cust_id = $_SESSION['CUST_ID'];
for($i=0;$i<count($_FILES['my_field']['name']);$i++)
{
if(trim($_FILES['my_field']['tmp_name'][$i]) != "")
{
$images = $_FILES['my_field']['tmp_name'][$i];
$new_images = "T_".$Cust_id."_".$_FILES['my_field']['name'][$i];
copy($_FILES["my_field"]["tmp_name"][$i],PRODUCT_IMG_PATH.$_FILES['my_field']['name'][$i]);
$width=400; //*** Fix Width & Heigh (Autu caculate) ***//
$size=GetimageSize($images);
$height=round($width*$size[1]/$size[0]);
$images_orig = ImageCreateFromJPEG($images);
$photoX = ImagesX($images_orig);
$photoY = ImagesY($images_orig);
$images_fin = ImageCreateTrueColor($width, $height);
ImageCopyResampled($images_fin, $images_orig, 0, 0, 0, 0, $width+1, $height+1, $photoX, $photoY);
ImageJPEG($images_fin,PRODUCT_IMG_PATH.$new_images);
ImageDestroy($images_orig);
ImageDestroy($images_fin);
echo "Resize Successful.<br>";
//*** Insert Record ***//
if($hide_img[$i]!=''){
@unlink(PRODUCT_IMG_PATH.$hide_img[$i]);
$sqlim = "UPDATE tbimgreal SET imgpreview='$new_images' ,imgthumb='".$_FILES["my_field"]["name"][$i]."' WHERE re_id='$hide_edit'";
$objQuery = $clsutilDB->MYSQLS_QUERY($sqlim);
}else{
$sqlig="INSERT INTO tbimgreal SET re_id='$hide_edit' ,imgpreview='$new_images' ,imgthumb='".$_FILES["my_field"]["name"][$i]."'";
$objQuery = $clsutilDB->MYSQLS_QUERY($sqlig);
}
}
}
$sql="REPLACE INTO realestate SET re_id='$hide_edit' ,cp_id='$Cust_id', reCategory='$txtCategory', reTopic='$txtRealestate' ,reDetail='$txtDetails', rePrice='$txtPrice', reProvince='$txtProvince', reGeo='$txtGeo', reStatus='$txtStatus', reType='$txtType' ,reRegist='".date('Y-m-d H:i:s')."'";
$clsutilDB->MYSQLS_QUERY($sql);
header("location:./index.php?fn=realEstate");
?>
Tag : PHP, MySQL
|
|
 |
 |
 |
 |
Date :
2011-04-21 22:07:06 |
By :
btgroup |
View :
991 |
Reply :
4 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลองใช้การ debug คำว่า echo "Now this step"; ไล่ใส่ไปยังตำแหน่งต่าง ๆ ก็จะได้รู้ว่ามันติดตรงไหนครับ
|
 |
 |
 |
 |
Date :
2011-04-22 06:01:12 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ทุกอย่างผ่านหมด ยกเว้น header("location:./index.php?fn=realEstate"); ไม่ยอม redirect
|
 |
 |
 |
 |
Date :
2011-04-22 09:22:25 |
By :
btgroup |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
test ที่ localhost ผ่านทุกอย่างนะครับ แต่ ที่ server ไม่ผ่านครับ ไม่ redirect
|
 |
 |
 |
 |
Date :
2011-04-22 11:26:09 |
By :
btgroup |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
หน้าขาวๆ เกิดการมี error แต่ server ไมได้เปิดให้แสดง error
ลองใส่นี่ไว้บรรทัดบนสุดละกัน
if (defined('E_DEPRECATED')) {
error_reporting(E_ALL ^ E_DEPRECATED);
} else {
error_reporting(E_ALL);
}
ini_set('display_errors', 'on');
|
 |
 |
 |
 |
Date :
2011-04-22 12:40:02 |
By :
PlaKriM |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|