 |
|
สวัสดีค่ะ ..
สำหรับ pop up ที่โชว์ขึ้นมามี ปุ่ม submit สำหรับการอัพโหลดรูปค่ะ และมีรูปภาพ(<img src="../Images/icon/icon_ok.gif" width="159" height="158" />) แทนปุ่ม กดเพื่อกลับไปหน้าเดิมค่ะ (แต่ยังไม่ได้ใส่สคริปอะไรเรย ตรงนี้ค่ะที่จะมาถาม)
แล้วเมื่อทำการ upload รูปในหน้าต่าง pop up เสร็จแล้ว เราจะให้มีปุ่ม สำหรับกลับไปหน้าเดิม พร้อมแสดงรูปที่อัพโหลด ด้วยอ่ะ
Code (PHP)
<?php
function popup($link,$width,$height){
$scriptpop="
window.open('$link','name','left=0,top=0,width=$width,height=$height,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes');";
return $scriptpop;
}
print '<span onclick="'.popup('imagephpajax/sample7_1.php','350','610').'" style="cursor:hand;" ><img src="images/icon/iconupload.jpg" width="20%", height="20%"><br/><center>คลิ๊กที่นี่เพื่ออัพโหลดรูปสินค้าของท่าน</center></span>';
// print '<body onload="'.popup('htt0p://www.google.co.th','200','150').'" >'; // tag body
?>
อันนี้เป็นโค้ดหน้า เดิม นะคะ
สำหรับโค้ดหน้าให้ทำการอัพโหลด จะมีฟอร์มตรงนี้ค่ะ !!
Code (PHP)
<form action="process_upload.php" method="post" target="uploadframe"
enctype="multipart/form-data" onsubmit="uploadimg(this); return false">
<div align="center">
<p>
<input type="file" id="myfile" name="myfile" />
<input type="submit" value="upload" />
</p>
<p><img src="../Images/icon/icon_ok.gif" width="159" height="158" /> <br />
<br />
<span class="style1">กรุณาคลิ๊กที่นี่เมื่อทำการจัดการหรืออัพโหลดรูปเสร็จแล้ว; ..</span></p>
</div>
<iframe id="uploadframe" name="uploadframe" src="process_upload.php" frameborder=0></iframe>
</form>
Tag : - - - -
|
|
 |
 |
 |
 |
Date :
2009-12-11 16:24:49 |
By :
unzeen |
View :
4954 |
Reply :
9 |
|
 |
 |
 |
 |
|
|
|
 |