|
 |
|
อัพรูป ไม่ได้ warning แก้ยังไงคะ เพราะ เซ็ต perrmission เป็น 777 แล้วหมด แล้ว แต่ก็แก้ไม่ได้สักที วอนผู้รู้ช่วยทีค่ะ |
|
 |
|
|
 |
 |
|
ช่วยตอบ เมล์ หรือออนไลน์ มาที่ [email protected] ช่วยหน่อยนะคะ กะลังหาอยู่
|
 |
 |
 |
 |
Date :
2009-09-20 14:21:19 |
By :
maltra |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
<?
$host = 'localhost';
$username = 'spsportr_garment';
$password = 'spsportsak';
$db = 'spsportr_garment';
$conn = mysql_connect($host, $username, $password);
if (!$conn) {
die('Could not connect: ' . mysql_error());
}
$db_selected = mysql_select_db($db, $conn);
if (!$db_selected) {
die ('Can\'t use $db : ' . $db. mysql_error());
}
$garid=$_POST["garid"];
$garname=$_POST["garname"];
$typeid=$_POST["typeid"];
$typename=$_POST["typename"];
$detail=$_POST["detail"];
$price=$_POST["price"];;
$image=$_POST["image"];
$sql="SELECT garid FROM garment where garid='$garid' ";
$result = mysql_query($sql);
$num_rows = mysql_num_rows($result);
if($num_rows>0)
{
echo "มี ID นี้แล้ว ";
}
elseif(empty($garid) or empty($garname) or $typeid=="none")
{
echo "กรอกข้อมูลไม่ครบ กรุณากรอกข้อมูลให้ครบ";
}
else
{
$Upload_Dir = "/domains/spsportrongfong.com/public_html/images";
$Upload_Dir = $Upload_Dir. basename( $_FILES['userfile']['name']);
if(move_uploaded_file($_FILES['userfile']['tmp_name'], $Upload_Dir))
{
echo "<center>เพิ่มข้อมูลและไฟล์รูป ". basename( $_FILES['userfile']['name']). " เรียบร้อยแล้ว</center>";
$image= $_FILES['userfile']['name'];
$sql="Insert into garment (garid,garname,typeid,detail,price,image) values('$garid','$garname','$typeid','$detail','$price','$image') ";
$result = mysql_query($sql);
}
else{
$sql="Insert into garment (garid,garname,typeid,detail,price,image) values('$garid','$garname','$typeid','$detail','$price','default.jpg')";
$result = mysql_query($sql);
echo "<center> เพิ่มข้อมูลเรียบร้อย แต่ไม่ได้อัพรูป หรือ การอัพโหลดมีปัญหา <center> ";
}
}
?>

ไม่รู้ว่าผิดที่ตรงไหน วอนผู้รู้ช่วยทีค่ะ
|
 |
 |
 |
 |
Date :
2009-09-20 14:34:54 |
By :
maltra |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ทำที่เครื่องได้หรือเปล่าอ่ะครับ มันฟ้องที่ คำสั่ง move_uploaded_file() อ่ะครับตรงนี้ตรวจสอบไดร์ที่จะให้มัน copy ไปเก้บถูกหรือครับอ่ะครับ ขอดูโค้ดหน่อยครับ
|
 |
 |
 |
 |
Date :
2009-09-20 14:35:46 |
By :
somparn |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ตอนที่ทำอยู่ในเครื่อง สามารถอัพไฟล์รูปได้หมดค่ะ แต่พอขึ้น เซิร์ฟเวอร์แล้ว ไม่สามารถทำได้ หาตามกระทู้ต่าง ๆ เค้าให้ไปเซ็ต โฟลเดอร์ให้เป็น 777 ก็เซ็ตแล้ว แต่ก็ยังเหมือนเดิม ไม่รู้ว่า อ้าง พาธไฟล์ ผิดรึเป่า
|
 |
 |
 |
 |
Date :
2009-09-20 14:39:41 |
By :
maltra |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
จะลองดูค่ะ อย่าเพิ่งไปไหนนะคะ
|
 |
 |
 |
 |
Date :
2009-09-20 14:41:50 |
By :
maltra |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณมากเลยนะคะ เพิ่งรูปเข้าฐานข้อมูลแล้วค่ะ แต่ ว่ารูปไม่ขึ้นแหะเดี่ญวลองเปลี่ยนรูปก่อนนคะ
|
 |
 |
 |
 |
Date :
2009-09-20 14:45:34 |
By :
maltra |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
โอเคแล้วค่ะ ได้แล้ว มั่ว มาสามวัน เพิ่งได้คุณมาช่วย บุญแท้ ๆ
แต่ขอให้คุณช่วยอีกไฟล์ได้ไหมคะ ได้ไม่ได้ก็ถามเรย ละกันค่ะ อิอิ ว่า
ไฟล์นี้ จะให้เป็นไฟล์โชว์ และจะแบ่งหน้า ให้มี โชว์ หน้าละสามรูป ตอนนี้โชว์แล้ว ค่ะ แต่ว่า ตัวเลข ที่จะคลิกหน้าต่อไปไม่ยอมขึ้น ค่ะ ช่วย แค่หน่อยนะคะ โค้ด ตามนี้เรย ค่ะ
<?
$host = 'localhost';
$username = 'spsportr_garment';
$password = 'spsportsak';
$db = 'spsportr_garment';
$conn = mysql_connect($host, $username, $password);
if (!$conn) {
die('Could not connect: ' . mysql_error());
}
$db_selected = mysql_select_db($db, $conn);
if (!$db_selected) {
die ('Can\'t use $db : ' . $db. mysql_error());
}
$sql = "select * from contact ";
$result = mysql_query($sql);
if (!$result) {
die('Invalid query: ' . mysql_error());
}
?>
<table width="775" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#000000">
<tr>
<td align="left" valign="top"><table width="775" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" valign="top"><img src="images/head.gif" width="775" height="154" /></td>
</tr>
<tr>
<td align="left" valign="top"><div id="toplink">
<table width="97%" height="51" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="middle" class="linktop"><img src="images/home_page.png" width="24" height="24" />
<a href="indexadmin.php" class="linktop">หน้าแรก</a> ::
<img src="images/star_full.png" width="24" height="24" /><a href="ashop.php" class="linktop">
สินค้า</a> ::
<img src="images/edit_page.png" width="24" height="24" />
<a href="abuy.php" class="linktop">
</a> :: <img src="images/comments.png" width="24" height="24" />
<a href="aabout.php" class="linktop">
</a> :: <img src="images/mail_edit.png" width="24" height="24" />
<a href="contact3.php" class="linktop">ข้อความถึง
</a> </td>
</tr>
</table>
</div></td>
</tr>
<tr>
<td align="left" valign="top" class="mainbg"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="29%" align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" valign="top"><div id="leftlink11">
<table width="90%" height="48" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="middle" class="linktop"><div align="center">:: Menu :: </div></td>
</tr>
</table>
</div></td>
</tr>
<tr>
<td align="left" valign="top"><table width="100%" border="0" cellspacing="10" cellpadding="0">
<tr>
<td class="bulet"><ul>
<li><a href="ajacket.php" class="headline"></a> </li>
<li><a href="agroup.php" class="headline"></a></li>
<li><a href="awork.php" class="headline"></a></li>
<li><a href="aworm.php" class="headline"></a></li>
<li><a href="asport.php" class="headline"></a></li>
<li><a href="asample.php" class="headline"></a></li>
</ul> </td>
</tr>
</table></td>
</tr>
<tr>
<td align="left" valign="top"><div id="leftlink22">
<table width="90%" height="48" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="middle" class="linktop"><div align="center">::::</div></td>
</tr>
</table>
</div></td>
</tr>
<tr>
<td align="left" valign="top"><table width="100%" border="0" cellspacing="10" cellpadding="0">
<tr>
<td class=""><div align="center"><img src="styles/blue.php" alt="My Clock" /></div>
</ul> <p><br>
</p></td>
</tr>
</table></td>
</tr>
</table></td>
<td width="71%" align="left" valign="top"><table width="540" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
</tr>
<tr>
<td align="left" valign="top"><div id="colum">
<table width="100%" height="48" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="middle" class="linktop">:: :: </td>
</tr>
</table>
</div></td>
</tr>
<tr>
<td align="left" valign="top">
<?
$pagesize = 3;
$totalpage = (int) ($totalrecord / $pagesize);
if (($totalrecord % $pagesize) != 0) {
$totalpage += 1;
}
if (isset($pageid)) {
//คำนวณหาหมายเลขเรคอร์ดแรกที่เราจะเลือกมา
$start = $pagesize * ($pageid - 1);
}
else {
$pageid = 1;
$start = 0;
}
$sql = "SELECT * FROM garment where typeid = '001' LIMIT $start, $pagesize;";
$result = mysql_query($sql);
while ($dbarr = mysql_fetch_array($result)) {
$image = $dbarr['image'];
$garname = $dbarr['garname'];
$detail = $dbarr['detail'];
$price = $dbarr['price'];
echo" <table width='100%' border='0' cellspacing='10' cellpadding='0'>
<tr>
<td align='left' valign='top'><div align='center'><a href='images/$image' target='_blank'><img src='images/$image' width='100' height='118' border='0' /></a></div></td>
<td align='left' valign='middle'><p><span class='style1'>$garname</span><br />
<br />
$detail</p>
<p><strong>ราคา $price บาท </strong></p>
<p align='right' class='style4'><a href='edit_01.php'>แก้ไข</a> / <a href='delete_01.php'>ลบ</a> </p></td>
</tr>
<tr>
<td width='21%' align='left' valign='top'> </td>
<td width='29%' align='left' valign='middle'> </td>
</tr>
";
}
?>
</table></td>
</tr>
</table>
</td>
</tr>
</table> </td>
</tr>
<tr>
<td align='left' valign='top'><div id='toplink'>
<table width='97%' height='51' border='0' align='center' cellpadding='0' cellspacing='0'>
<tr>
<td align='center' valign='middle' class='bottom'>By SPsportrongfong © 2009 All Rights Reserved</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
|
 |
 |
 |
 |
Date :
2009-09-20 14:53:44 |
By :
maltra |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณค่ะ
|
 |
 |
 |
 |
Date :
2009-09-20 20:31:12 |
By :
maltra |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 03
|