Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > PHP > PHP Forum > รบกวนช่วยดูโค้ดหน่อยครับ ผมเอาโค้ดอัพโหลดภาพไปใส่แล้วมันให้insert ไม่ได้ ถ้าไม่ใส่โค้ดอัพโหลดภาพมันinsert ได้ปกติครับ



 

รบกวนช่วยดูโค้ดหน่อยครับ ผมเอาโค้ดอัพโหลดภาพไปใส่แล้วมันให้insert ไม่ได้ ถ้าไม่ใส่โค้ดอัพโหลดภาพมันinsert ได้ปกติครับ

 



Topic : 092972



โพสกระทู้ ( 191 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook



รบกวนช่วยดูโค้ดหน่อยครับ ผมเอาโค้ดอัพโหลดภาพไปใส่แล้วมันให้insert ไม่ได้ ถ้าไม่ใส่โค้ดอัพโหลดภาพมันinsert ได้ปกติครับ ไม่แน่ใจว่าแทรกโค้ดผิดตำแหน่งหรือป่าว รบกวนหน่อยครับทุกท่าน
----
<?
session_start();
?>
<html>
<head>
<title></title>
<meta http-equiv="content-type" charset="utf-8" />
</head>
<body>
<?

$date = $_POST['date'];
$rdocom = $_POST['rdocom'];
$cause = $_POST['txta_cause'];
$demand = $_POST['txta_demand'];
$detail = $_POST['txta_detail'];
$offer = $_POST['lml_offer'];
$namelabel = $_POST['txtnamelabel'];
$num = $_POST['txtnum'];
$producerid = 1234;
$qty = $_POST["txtnum"];
echo $name = $_POST['txtName'];
?>
<?


mysql_connect("้host","1234","1234");
mysql_select_db("documentupload");






/*---------------------ส่วนของการอัพโหลดภาพ------------------------------------------------------------------------------------- */

$sur = strrchr($_FILES['filUpload']['name'],".");
$newfilename = (Date("dmy_His").$sur);
echo $newfilename;

if(move_uploaded_file($_FILES["filUpload"]["tmp_name"],"myfile/".$newfilename))
{
echo "Copy/Upload Complete<br>";

/* --------------------------------------------------------------------------------------------------------------------- */
mysql_query("SET NAMES UTF8");
$strSQL = "
INSERT INTO oder_work (order_for,order_date_begin,order_date_finish,numdetail,order_name_labels,order_offer_id,order_cause,order_demand,order_detail,order_thumbnails,order_filesname,order_producer_id)
VALUES
('".$rdocom."','".date("Y-m-d H:i:s")."','".$date."' ,'".$qty."','".$namelabel."','".$offer."','".$cause."','".$demand."','".$detail."','".$name."','".$newfilename."','".$producerid."')
";

mysql_query($strSQL) or die(mysql_error());


$strOrderID = mysql_insert_id();

for($i=0;$i<=(int)$_SESSION["intLine"];$i++)
{
if($_SESSION["stritem_id"][$i] != "")
{
$strSQL = "
INSERT INTO order_work_detail(order_id,item_id)
VALUES
('".$strOrderID."','".$_SESSION["stritem_id"][$i]."')
";
mysql_query($strSQL) or die(mysql_error());
}
}
}

mysql_close();

session_destroy();

//header("location:finish_order.php?OrderID=".$strOrderID);




?>

<center><a href="full_view_fix.php?OrderID=<?=$strOrderID ?>" title="View">ดูงานที่สั่งทำ</a></center>

</body>
</html>



Tag : PHP, MySQL









ประวัติการแก้ไข
2013-03-26 10:29:02
Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2013-03-26 10:27:58 By : dagonov View : 741 Reply : 7
 

 

No. 1



โพสกระทู้ ( 4,169 )
บทความ ( 7 )

Hall of Fame 2012

สถานะออฟไลน์


อธิบาย ให้เครียหน่อยครับ อ่านแล้วงงจุงเบย






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-03-26 10:36:41 By : Ex-[S]i[L]e[N]t
 


 

No. 2



โพสกระทู้ ( 191 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

คือผมเอาโค้ด อัพโหลดไปใส่ แล้วมันเพิ่มข้อมูลไม่ได้ครับ ตรง /*---------------------ส่วนของการอัพโหลดภาพ------------------------------------------------------------------------------------- */

คือโค้ดที่ผมเพิ่มไป
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-03-26 10:44:47 By : dagonov
 

 

No. 3



โพสกระทู้ ( 4,169 )
บทความ ( 7 )

Hall of Fame 2012

สถานะออฟไลน์


ขอดูหน้าฟอร์มครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-03-26 10:47:36 By : Ex-[S]i[L]e[N]t
 


 

No. 4



โพสกระทู้ ( 191 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

gfhfgh

โค้ดครับ
<?
session_start();
?>
<!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-language" content="en" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="copyright" content="R. Schoo" />

<link rel="stylesheet" media="screen" href="styles/vlaCal-v2.1.css" type="text/css" />
<link rel="stylesheet" media="screen" href="styles/vlaCal-v2.1-adobe_cs3.css" type="text/css" />
<link rel="stylesheet" media="screen" href="styles/vlaCal-v2.1-apple_widget.css" type="text/css" />

<script type="text/javascript" src="jslib/mootools-1.2-core-compressed.js"></script>
<script type="text/javascript" src="jslib/vlaCal-v2.1-compressed.js"></script>

<!-- You could also include the uncompressed versions for developing purposes:
<script type="text/javascript" src="jslib/mootools-1.2-core.js"></script>
<script type="text/javascript" src="jslib/vlaCal-v2.1.js"></script>-->

<title>ใบสั่งงาน</title>

<style>
body {
cursor: default;
text-align: left;
font-family: calibri, arial, sans-serif;
font-size: 13px;
margin: 0;
padding: 5px;
background-image: url(images/paper_1024.jpg);
}

table th {
vertical-align: top;
}

input {
text-align: center;
font-family: calibri, arial, sans-serif;
font-size: 13px;
background-color: white;
border: 1px solid;
border-color: #abadb3 #dbdfe6 #e3e9ef #e2e3ea;
padding: 2px;
}
input:focus, input:hover {
border-color: #5794bf #b7d5ea #c7e2f1 #c5daed;
}

.pickerImg {
position: absolute;
margin-left: -16px;
margin-top: 5px;
cursor: pointer;
}
.infoBox {
background-color: #fefdec;
border: 1px solid #edebcd;
padding: 6px;
margin-bottom: 20px;
}
</style>

<script type="text/javascript">
window.addEvent('domready', function() {
new vlaDatePicker('exampleI');
new vlaDatePicker('exampleII', { separator: '-', leadingZero: false, twoDigitYear: true, offset: { y: 3 }, alignX: 'center', alignY: 'bottom' });
new vlaDatePicker('exampleIII', { openWith: 'togglePicker', offset: { y: -2, x: 2 }, separateInput: { day: 'day', month: 'month', year: 'year' } });
new vlaDatePicker('exampleIV-A', { style: 'adobe_cs3', offset: { y: 1 }, format: 'm/d/y', ieTransitionColor: '' });
new vlaDatePicker('exampleIV-B', { style: 'apple_widget', offset: { x: 3, y: 1 } });
new vlaCalendar('exampleV', { startMonday: true });
new vlaDatePicker('exampleVI', { defaultView: 'year' });
new vlaDatePicker('exampleVII', { prefillDate: { day: 12, month: 12, year: 2012 } });
});

<!--//////////////เรียกหน้าต่างย่อย////////////////// -->
function fncDisplay(_check,i){
if(_check == true){
document.getElementById('txtName'+i).style.display='';
}
else{
document.getElementById('txtName'+i).style.display='none';
}
}

function fncOpenPopup()
{
window.open('item.php','popup-name','width=700,height=500,toolbar=0, menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0');
}

<!--***********ฟังช์ชั่น ตรวจสอบค่าว่างradio button-********************** -->
function fncSubmit()
{
if(document.form1.rdo1.checked == false && document.form1.rdo2.checked == false && document.form1.rdo3.checked == false && document.form1.rdo4.checked == false && document.form1.rdo5.checked == false )
{
alert('กรุณาเลือกหัวข้อ ทำเพื่อบริษัท ');
return false;
}
document.form1.submit();
}



</script>
<!-- //////////////////////////////////////////////////////////////// -->



</head>

<body>
<?
mysql_connect("download.advanceseeds.com","wisanu","1234");
mysql_select_db("documentupload");
?>
<!--<div class="infoBox">
<b>This example page will only work on a webserver - AJAX requests are made to PHP files.</b><br />
For documentation and more examples visit <a href="http://dev.base86.com/scripts/vista-like_ajax_calendar_version_2.html">http://dev.base86.com/scripts/vista-like_ajax_calendar_version_2.html</a>.
</div> -->
<form action="save_checkout_fix.php" method="post" name="form1" onSubmit="JavaScript:return fncSubmit();" enctype="multipart/form-data">
<table width="618" height="632" border="0" align="center" cellpadding="0" cellspacing="0" frame="border" >
<tr>
<td colspan="3">&nbsp;</td>
<td width="123"><div align="left"><img src="images/1.png" width="122" height="30" /></div></td>
<td width="82"><div align="left"><input id="exampleI" name="date" type="text" style="width: 80px;" maxlength="10" /></div></td>
</tr>
<tr>
<td colspan="5"><center><img src="images/3.png" width="170" height="35" /></center></td>
</tr>
<tr>
<td width="140"><img src="images/4.png" width="140" height="25" /></td>
<td colspan="4"><input name="rdocom" type="radio" value="Advance" id="rdo1" >Advance
<input name="rdocom" type="radio" value="Star" id="rdo2" >Star
<input name="rdocom" type="radio" value="Flower" id="rdo3" >Flower
<input name="rdocom" type="radio" value="APAS" id="rdo4" >APAS
<input name="rdocom" type="radio" value="Promotion" id="rdo5" >Promotion

</td>
</tr>
<tr>
<td><img src="images/5.png" width="140" height="25" /></td>
<td colspan="4"><label for="select"></label>
<select name="lml_offer" >
<option>-กรุณาเลือก-</option>

</select></td>
</tr>
<tr>
<td><img src="images/6.png" width="140" height="25" /></td>
<td colspan="4" valign="top">


<p>

</p>
<p><input type="button" name="btnOpen" value="เพิ่มลักษณะงาน" OnClick="fncOpenPopup();" style="background:#CCC"></p></td>

</tr>
<tr>
<td><img src="images/num.png" width="65" height="25" /></td>
<td width="153"><input type ="text" name="txtnum" style="width: 150px;"/></td>
<td width="121"><img src="images/namelabel.png" width="121" height="34" />
</td>
<td colspan="2"><input type ="text" name = "txtnamelabel" /></td>
</tr>
<tr>
<td><img src="images/8.png" width="140" height="25" /></td>
<td colspan="4">
<textarea name="txta_cause" id="textarea" cols="73" rows="5" ></textarea></td>
</tr>
<tr>
<td><img src="images/9.png" width="140" height="25" /></td>
<td colspan="4"><textarea name="txta_demand" id="textarea" cols="73" rows="5" ></textarea></td>
</tr>
<tr>
<td><img src="images/10.png" width="140" height="25" /></td>
<td colspan="4"><textarea name="txta_detail" id="textarea" cols="73" rows="5" ></textarea></td>
</tr>
<tr>
<td><img src="images/name.png" width="65" height="25" /></td>
<td colspan="4"><table width="93" border="0" cellpadding="0" cellspacing="0">
<tr>


<td width="6"><br /></td>
</tr>
</table>
<input type="text" name="txtName"></td>
</tr>
<tr>
<td><img src="images/11.png" width="140" height="25" /></td>
<td><input type="file" name="filUpload" /></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td colspan="2"><table width="200" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="65"><img src="images/13.png" width="65" height="25" /></td>
<td width="96">&nbsp;</td>
<td width="17"><img src="images/14.png" width="55" height="25" /></td>
</tr>
</table></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td colspan="2"><input name="" type="image" src="images/save-button-png-hi.png" width="150" height="55" /></td>
<td>&nbsp;</td>
</tr>
</table>
</form>
</body>
</html>
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-03-26 10:54:37 By : dagonov
 


 

No. 5



โพสกระทู้ ( 4,169 )
บทความ ( 7 )

Hall of Fame 2012

สถานะออฟไลน์


Code (PHP)
mysql_connect("้host","1234","1234"); //เปลี่ยน connect ใหม่
mysql_connect("localhost","root","1234"); //example connect



ประวัติการแก้ไข
2013-03-26 11:03:19
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-03-26 11:03:05 By : Ex-[S]i[L]e[N]t
 


 

No. 6



โพสกระทู้ ( 191 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

ตรงconnectไม่เกี่ยวครับผมใส่มาเองเพราะรันบนhostจริงครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-03-26 11:14:57 By : dagonov
 


 

No. 7



โพสกระทู้ ( 4,169 )
บทความ ( 7 )

Hall of Fame 2012

สถานะออฟไลน์


ลองเช็ค path ตรงรึเปล่า เปิด permission 777 ด้วยครับ


ประวัติการแก้ไข
2013-03-26 11:33:13
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-03-26 11:32:46 By : Ex-[S]i[L]e[N]t
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : รบกวนช่วยดูโค้ดหน่อยครับ ผมเอาโค้ดอัพโหลดภาพไปใส่แล้วมันให้insert ไม่ได้ ถ้าไม่ใส่โค้ดอัพโหลดภาพมันinsert ได้ปกติครับ
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 01
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่