|
 |
|
ช่วยดูโค๊ดให้หน่อยครับ ทำมาหลายวันแล้วครับ , กรุณาป้อนรายละเอียดให้ครบถ้วน , ไม่สามารถแก้ไขในฐานข้อมูลได้ |
|
 |
|
|
 |
 |
|

Code (PHP)
<?php
if (check_useradmin())
{
if(empty($news_name)||empty($detail))
{
echo "<center><b class='redbig'>กรุณาป้อนรายละเอียดให้ครบถ้วน</b></center>";
require_once("../include/footeradmin.php");
exit;
}
// นำฟังก์ชั่น Ramdom password มาใช้เพื่อกำหนดชื่อไฟล์ป้องกันการซ้ำกัน
function random_password($len)
{
srand((double)microtime()*10000000);
$chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
$ret_str = "";
$num = strlen($chars);
for($i = 0; $i < $len; $i++)
{
$ret_str.= $chars[rand()%$num];
$ret_str.="";
}
return $ret_str;
}
// echo random_password(8);
$passw = random_password(7);
$path="news";
$filenewcon = strstr($file,'.');
$now = date("Dgis");
if(empty($file))
{
echo"";
}
else
{
copy($file ,"$path/$passw$now$filenewcon");
copy($_FILES["fileUpload"]["tmp_name"],"MyResize/".$_FILES["fileUpload"]["name"]);
$url="admin/$path/$passw$now$filenewcon";
}
if (edit_news($news_id,$news_name,$detail,$start_date,$stop_date,$picture,$url,$file))
{
echo "<BR><center><b class='bluebig'>แก้ไขข่าว '$news_name' ในฐานข้อมูลเสร็จเรียบร้อยแล้ว</b></center>";
echo "<META HTTP-EQUIV='Refresh' CONTENT='1;URL=managenews_form.php '>";
}
else
{
echo "<BR><center><b class='redbig'> ข่าวเรื่อง '$mews_name' ไม่สามารถแก้ไขในฐานข้อมูลได้</b></center>";
}
}
else
{
echo "<center><b class='redbig'>คุณไม่มีสิทธิเข้ามาในส่วนนี้</b></center>";
}
echo"<BR><BR>";
?>
Tag : - - - -

|
|
 |
 |
 |
 |
Date :
2009-08-29 00:15:56 |
By :
atung |
View :
812 |
Reply :
0 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
|
|

|
Load balance : Server 03
|