Register Register Member Login Member Login Member Login Forgot Password ??
PHP Tutorial (Hypertext Preprocessor), ASP Tutorial (Active Server Pages), ASP.NET Tutorial (.Net 1.1,2.0,3.5)
   
   
  Registered : 70,205
   
 
HOME > Free Web Script > PHP > แนะนำสคริปอับโหดและพรีวิวภาพครับ
Search

แนะนำสคริปอับโหดและพรีวิวภาพครับ

 
หวังว่าจะมีประโ ยชน์สำหรับมือใ หม่หัดขับนะครับ
แบ่งออกเป็น 3 ไฟล์นะครับ

ไฟล์ที่ 1 เอาไว้โชว์ภาพ ในที่นี้ผมตั้งเป็น index.html
Code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript">
function popupUploadImage( f_name, e_name, path ) {
window.open("./popUploadImages.php","name","top=300,left=450,height=250,width=400, status=1");
}

</script>

</head>

<body>
<img src="" name="pImage" id="pImage"/>
<br />
<a href="#" onclick="popupUploadImage();"><b>[ Browse ]</b></a><br />
</body>
</html>


ไฟล์ที่ 2 popUploadImages.php

Code
<html>
<head>
<title>Upload Images</title>
</head>

<body>
<form name="uploadImage" action="uploadImages.php" method="post" enctype="multipart/form-data">
<table width="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="darkbrown12_bold">?</td>
</tr>
<tr>
<td class="darkbrown12_bold"><div align="center">Select Image</div></td>
</tr>
<tr height="35">
<td align="center"><input type="file" name="file" class="inputBox" size="30"></td>
</tr>
<tr height="35">
<td align="center">?</td>
</tr>
<tr height="35">
<td align="center">
<input type="submit" name="submitPage" value="upload" class="button80">
</td>
</tr>
</table>
</form>
</body>
</html>


ไฟล์ที่ 3 uploadImages.php
Code
<?php

if($file){
$path = "images/";
$fileType = explode('.', $file_name);
$fileName = date('YmdHis');
$fileName = $fileName.".".$fileType[1];
$uploadFile = $path."".$fileName;
copy($file, $uploadFile);


$img = "./images/$fileName";
$Ipreview = "pImage";


}

?>

<html>
<head>

<script language="javascript">
function returnValue() {
window.opener.document.getElementById('<? echo $Ipreview?>').src = "<?php echo $img ?>";
window.close();
}
</script>
</head>
<body onLoad="returnValue()">
</body>
</html>


 

  Score Rate :
  Create Date : 2009-03-06 11:59:31
  View : 14,939
  Download : No files
     

Sponsored Links
 
 
Ads Contact : 08-1987-6107
Download Google Chorme
 
Ads Contact : 08-1987-6107

Sponsored Links
WordPress : Download WordPress ติดตั้ง WordPress สร้าง Blog ง่าย ๆ ด้วย Wordpress
WordPress เป็นโปรแกรมประเภท Blog ที่สามารถสร้าง Blog ได้อย่างง่ายดาย และมี Plugin รวมทั้ง Themes ให้เลือกมากมาย
Rate : Update : 2009-10-23 08:26:37 View : 5,312
PHP Photo Album / Gallery
เป็น Script PHP สำหรับทำ Photo Gallery จุดเด่นคือมีขนาดเล็ก และ ใช้งานง่ายครับ สามารถสร้าง Category ได้
Rate : Update : 2009-05-25 07:10:00 View : 16,572
WYSIWYG - Yahoo! UI Library: Rich Text Editor
WYSIWYG - Text editor on your web freeeee !!!
Rate : Update : 2009-04-04 11:20:32 View : 6,513
มาทำ music libraries แบบง่ายๆ
มาทำ music libraries แบบง่ายๆ
Rate : Update : 2009-03-18 07:21:08 View : 7,815
 
 
 
© www.ThaiCreate.Com. 2003-2009 All Rights Reserved. My network : ThaiGoodWeb.Com , DVDmono.com
Comments & Suggestions Please Contact Us : thaicreate at hotmail dot com [Conditions Privacy Statement] ติดต่อโฆษณา 01-987-6107 อัตราราคา คลิกที่นี่