|
 |
|
ใช้งาน window.location แต่มันไม่รีเฟรชหน้าให้ครับ แต่ข้อมูลบันทึกให้ปกติ |
|
 |
|
|
 |
 |
|
คือกดอัพโหลดไฟล์และชื่อนามสกุลต่าง และพอกด Submit แล้วไห้มันรีเฟรชไปอีกหน้าครับ
ตอนนี้มันไม่รีเฟรชหน้าให้ครับ ลองคำสั่งอื่นแล้วก็ยังไม่ได้ ไม่รุผิดตรงไหนหรือเปล่าครับ
Code (PHP)
<?
$Act=$_GET['Act'];
switch($Act){
case 'add' :
function upimg($img,$imglocate){
global $file_up;
if($img['name']!=''){
$fileupload1=$img['tmp_name'];
$g_img=explode(".",$img['name']);
$file_up=time().".".$g_img[1];
if($fileupload1){
$array_last=explode(".",$file_up);
$c=count($array_last)-1;
$lastname=strtolower($array_last[$c]);
if($lastname=="gif" or $lastname=="jpg" or $lastname=="jpeg" or $lastname=="png"){
@copy($fileupload1,$imglocate.$file_up);
}
}
}
}
if($_FILES['file']['name']!=""){
upimg($_FILES['file'],"upload/");
echo "<script language=\"javascript\">";
echo "var pl=top.document.getElementById('mypic1');";
echo "pl.innerHTML=\"<img src='upload/".$file_up."' width='120' height='150' />\";";
echo "top.document.formregis.action='';";
echo "top.document.formregis.target='';";
echo "</script>";
$file_up=$file_up;
$memberid=$_POST['memberid'];
$name=$_POST['name'];
$lastname=$_POST['Lastname'];
$nickname=$_POST['Nickname'];
$tel=$_POST['Tel'];
$time_add = date('Y-m-d H:i:s');
$p_date=date('Y-m-d');
$insert=insert("user","name,lastname,nickname,tel,staff,time_test,u_date,name_file"," '".$name."','".$lastname."','".$nickname." ',' ".$tel."','".$memberid." ','".$time_add." ','".$p_date."','".$file_up."'");
if($insert){
$userId = mysql_insert_id();
echo "<script>";
echo "alert('ระบบทำการสมัครสมาชิกเรียบร้อย');";
echo "window.location='test100_l.php?uid=$userId';"; // บรรทัดนี้ครับที่ไม่ทำงาน ไม่รีเฟรชหน้าให้
echo "</script>";
} break;
}
}
?>
Tag : PHP

|
ประวัติการแก้ไข 2014-02-19 15:40:58
|
 |
 |
 |
 |
Date :
2014-02-19 15:41:24 |
By :
wita |
View :
1437 |
Reply :
2 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
echo("window.top.location.href='test100_l.php?uid=$userId';");
|
 |
 |
 |
 |
Date :
2014-02-19 15:48:14 |
By :
apisitp |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 05
|