 |
|
เวลาอัพโหลดแล้วขึ้นว่าแบบนี้ครับ โฟรเดอร์ผมก็ตั้งเป็น 777 แล้วครับ
Warning: copy() [function.copy]: open_basedir restriction in effect. File() is not within the allowed path(s): (/home/momo21/:/tmp:/var/tmp:/usr/local/lib/php/) in /home/momo21/domains/momo21.com/public_html/admin/1234.php on line 2
โค้ด
Code (PHP)
<?php
if(copy($_FILES["q_image"]["tmp_name"],"img/".$_FILES["q_image"]["name"]))
{
include('config.inc.php');
$strSQL = "INSERT INTO puestion ";
$strSQL .="(q_image) VALUES ('".$_FILES["q_image"]["name"]."')";
}
?>
<? // ข้อมูลด้านล่างนี้บันทึกลงฐาน แต่ส่วนบนไม่บันทึกครับ
include('config.inc.php');
$q_ip=$REMOTE_ADDR ;
$q_message = htmlspecialchars($q_message);
$q_name = htmlspecialchars($q_name);
$q_email = htmlspecialchars($q_email);
$q_message = nl2br($q_message);
$q_message = addslashes($q_message);
$q_name = addslashes($q_name);
$q_email = addslashes($q_email);
$a = date("j"); // วันที่
$b = strftime("%B"); // เดือนเต็ม
$c = strftime("%Y")+543; // ปี พ.ศ.
$d = date("H:i:s"); // เวลา
$q_date = "$a $b $c - $d";
$sql = "insert into question (q_topic, q_message, q_name, q_email, q_ip, q_datetime )
values ('$_POST[q_topic]','$_POST[q_message]','$_POST[q_name]','$_POST[q_email]','$_POST[q_ip]','$q_date')";
$result = mysql_db_query($dbname, $sql);
if (!$result) {
echo("เอ็กซิคิวต์คำสั่ง SQL ไม่ได้ " . mysql_error() );
exit;
}
else {
echo "<center><font size=2 color=#ff3300><b>ได้เพิ่มประเดนข่าวเรียบร้อย</b></font><br>";
echo "<font size=2 color=#ff3300><center><b>โปรดรอสักครู่</b></center></font></center>";
echo "<meta http-equiv='refresh' content='4;url=inputform.html'>";
}
?>

Tag : PHP, MySQL, CakePHP
|
|
 |
 |
 |
 |
Date :
2012-01-15 02:40:31 |
By :
superdong |
View :
1116 |
Reply :
2 |
|
 |
 |
 |
 |
|
|
|
 |