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 > ถามเรื่อง แบบประเมินหน่อยครับ อยากบันทึกลงในฐานข้อมูล ต้องเขียนโค้ดยังไงครับ



 

ถามเรื่อง แบบประเมินหน่อยครับ อยากบันทึกลงในฐานข้อมูล ต้องเขียนโค้ดยังไงครับ

 



Topic : 124044



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



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



22222




อันนี้โค้ดหน้าประเมินนะครับ
Code (PHP)
<!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>แบบประเมินความพึงพอใจเว็บไซต์</title>
<style type="text/css">
body {
	background-color: #FFDDBB;
	background-image: url();
	background-repeat: no-repeat;
}
</style>
</head>

<body>
<?php
	session_start();
	if($_SESSION['UserID'] == "")
	{
		echo "Please Login!";
		exit();
	}

	if($_SESSION['Status'] != "USER")
	{
		echo "This page for User only!";
		exit();
	}	
	
	include ('config.php'); //** เชื่อมต่อฐานข้อมูล
	$strSQL = "SELECT * FROM member WHERE UserID = '".$_SESSION['UserID']."' ";
	$objQuery = mysql_query($strSQL);
	$objResult = mysql_fetch_array($objQuery);
?>
<form id="form1" name="form1" method="post" action="SaveAM.php">
  <table width="930" height="1413"  align="center" bgcolor="#FFFFFF">
    <tr>
      <td height="1407"><h1 align="center"><input type="hidden" name="txtname1"   value=" <?php echo $objResult["Username"];?>" />แบบประเมินความพึงพอใจเว็บไซต์</h1>
        <p> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ขอความอนุเคราะห์ท่านในการตอบแบบประเมินความพึงพอใจในการให้บริการ &nbsp;&nbsp;&nbsp;เพื่อประโยชน์ในการพัฒนาและปรับปรุงเว็บไซต์ให้ดียิ่งขึ้น &nbsp;&nbsp;&nbsp;ซึ่งความคิดเห็นของท่านถือเป็นความลับจะไม่มีการเปิดเผยข้อมูลเป็นรายบุคคล</p>
        <p>&nbsp;&nbsp;&nbsp;&nbsp;<u><strong>คำชี้แจง</strong></u></p>
        <p>&nbsp;&nbsp;&nbsp;&nbsp;1. ข้อมูลนี้จะถูกเก็บเป็นความลับเฉพาะ กรุณาตอบให้ตรงกับความเป็นจริงที่สุด</p>
        <p>&nbsp;&nbsp;&nbsp;&nbsp;2. โปรดอ่านข้อความอย่างละเอียดและกดปุ่มเลือกในช่องระดับที่เป็นความจริงหรือใกล้เคียงตรงกับความคิดเห็นของท่านมากที่สุดในแต่ละหัวข้อ &nbsp;&nbsp;&nbsp;&nbsp;โดยพิจารณาเกณฑ์ของแต่ละระดับ </p>
        <table width="792" align="center" height="217" border="1">
          <tr>
            <td width="394" align="center"><h4>1.ด้านเนื้อหา </h4></td>
            <td width="58" align="center">มากที่สุด</td>
            <td width="58" align="center">มาก</td>
            <td width="58" align="center">ปานกลาง</td>
            <td width="58" align="center">น้อย</td>
            <td width="58" align="center">น้อยที่สุด</td>
          </tr>
          <tr>
            <td height="33">&nbsp;1. เนื้อหามีความชัดเจน ถูกต้องเชื่อถือได้
              <input type="hidden"  name="txt1" value="ประเมินหัวข้อ1"/></td>
            <td align="center"><input type="radio" name="radio1" id="radio1" value="5" /></td>
            <td align="center"><input type="radio" name="radio1" id="radio1" value="4" /></td>
            <td align="center"><input type="radio" name="radio1" id="radio1" value="3" /></td>
            <td align="center"><input type="radio" name="radio1" id="radio1" value="2" /></td>
            <td align="center"><input type="radio" name="radio1" id="radio1" value="1" /></td>
          </tr>
          <tr>
            <td height="32">&nbsp;2. ข้อมูลมีความทันสมัยน่าสนใจ
              <input type="hidden"  name="txt2" value="ประเมินหัวข้อ2"/></td>
            <td align="center"><input type="radio" name="radio2" id="radio2" value="5" /></td>
            <td align="center"><input type="radio" name="radio2" id="radio2" value="4" /></td>
            <td align="center"><input type="radio" name="radio2" id="radio2" value="3" /></td>
            <td align="center"><input type="radio" name="radio2" id="radio2" value="2" /></td>
            <td align="center"><input type="radio" name="radio2" id="radio2" value="1" /></td>
          </tr>
          <tr>
            <td height="34">&nbsp;3. ปริมาณเนื้อหามีเพียงพอกับความต้องการ
              <input type="hidden"  name="txt3" value="ประเมินหัวข้อ3"/></td>
            <td align="center"><input type="radio" name="radio3" id="radio3" value="5" /></td>
            <td align="center"><input type="radio" name="radio3" id="radio3" value="4" /></td>
            <td align="center"><input type="radio" name="radio3" id="radio3" value="3" /></td>
            <td align="center"><input type="radio" name="radio3" id="radio3" value="2" /></td>
            <td align="center"><input type="radio" name="radio3" id="radio3" value="1" /></td>
          </tr>
          <tr>
            <td height="34">&nbsp;4. การจัดลำดับเนื้อหาเป็นขั้นตอน มีความต่อเนื่อง อ่านแล้วเข้าใจ
              <input type="hidden"  name="txt4" value="ประเมินหัวข้อ4"/></td>
            <td align="center"><input type="radio" name="radio4" id="radio4" value="5" /></td>
            <td align="center"><input type="radio" name="radio4" id="radio4" value="4" /></td>
            <td align="center"><input type="radio" name="radio4" id="radio4" value="3" /></td>
            <td align="center"><input type="radio" name="radio4" id="radio4" value="2" /></td>
            <td align="center"><input type="radio" name="radio4" id="radio4" value="1" /></td>
          </tr>
          <tr>
            <td height="39">&nbsp;5. ข้อความในเว็บไซด์ถูกต้องตามหลัก ภาษา และไวยากรณ์
              <input type="hidden"  name="txt5" value="ประเมินหัวข้อ5"/></td>
            <td align="center"><input type="radio" name="radio5" id="radio5" value="radio" /></td>
            <td align="center"><input type="radio" name="radio5" id="radio5" value="radio" /></td>
            <td align="center"><input type="radio" name="radio5" id="radio5" value="radio" /></td>
            <td align="center"><input type="radio" name="radio5" id="radio5" value="radio" /></td>
            <td align="center"><input type="radio" name="radio5" id="radio5" value="radio" /></td>
          </tr>
        </table>
        <br />
        <table width="792" align="center" height="272" border="1">
          <tr>
            <td width="394" height="35" align="center"><h4>2.ด้านการออกแบบและจัดรูปแบบของเว็บไซต์</h4></td>
            <td width="58" align="center">มากที่สุด</td>
            <td width="58" align="center">มาก</td>
            <td width="58" align="center">ปานกลาง</td>
            <td width="58" align="center">น้อย</td>
            <td width="58" align="center">น้อยที่สุด</td>
          </tr>
          <tr>
            <td height="34">&nbsp;6. การจัดรูปแบบเว็บไซต์ง่ายต่อการอ่านและการใช้งาน
              <input type="hidden"  name="txt6" value="ประเมินหัวข้อ6"/></td>
            <td align="center"><input type="radio" name="radio6" id="radio6" value="5" /></td>
            <td align="center"><input type="radio" name="radio6" id="radio6" value="4" /></td>
            <td align="center"><input type="radio" name="radio6" id="radio6" value="3" /></td>
            <td align="center"><input type="radio" name="radio6" id="radio6" value="2" /></td>
            <td align="center"><input type="radio" name="radio6" id="radio6" value="1" /></td>
          </tr>
          <tr>
            <td height="32">&nbsp;7. สีสันในการออกแบบเว็บไซด์มีความเหมาะสม
              <input type="hidden"  name="txt7" value="ประเมินหัวข้อ7"/></td>
            <td align="center"><input type="radio" name="radio7" id="radio7" value="5" /></td>
            <td align="center"><input type="radio" name="radio7" id="radio7" value="4" /></td>
            <td align="center"><input type="radio" name="radio7" id="radio7" value="3" /></td>
            <td align="center"><input type="radio" name="radio7" id="radio7" value="2" /></td>
            <td align="center"><input type="radio" name="radio7" id="radio7" value="1" /></td>
          </tr>
          <tr>
            <td height="34">&nbsp;8. สีพื้นหลังกับสีตัวอักษรมีความเหมาะสมต่อการอ่าน
              <input type="hidden"  name="txt8" value="ประเมินหัวข้อ8"/></td>
            <td align="center"><input type="radio" name="radio8" id="radio8" value="5" /></td>
            <td align="center"><input type="radio" name="radio8" id="radio8" value="4" /></td>
            <td align="center"><input type="radio" name="radio8" id="radio8" value="3" /></td>
            <td align="center"><input type="radio" name="radio8" id="radio8" value="2" /></td>
            <td align="center"><input type="radio" name="radio8" id="radio8" value="1" /></td>
          </tr>
          <tr>
            <td height="39">&nbsp;9. ขนาดตัวอักษร และรูปแบบตัวอักษร มีความสวยงามและอ่านได้ง่าย
              <input type="hidden"  name="txt9" value="ประเมินหัวข้อ9"/></td>
            <td align="center"><input type="radio" name="radio9" id="radio9" value="5" /></td>
            <td align="center"><input type="radio" name="radio9" id="radio9" value="4" /></td>
            <td align="center"><input type="radio" name="radio9" id="radio9" value="3" /></td>
            <td align="center"><input type="radio" name="radio9" id="radio9" value="2" /></td>
            <td align="center"><input type="radio" name="radio9" id="radio9" value="1" /></td>
          </tr>
          <tr>
            <td height="40">&nbsp;10. มีความเร็วในการแสดงวิดีโอ ภาพ ตัวอักษร และ ข้อมูลต่างๆ
              <input type="hidden"  name="txt10" value="ประเมินหัวข้อ10"/></td>
            <td align="center"><input type="radio" name="radio10" id="radio19" value="5" /></td>
            <td align="center"><input type="radio" name="radio10" id="radio19" value="4" /></td>
            <td align="center"><input type="radio" name="radio10" id="radio19" value="3" /></td>
            <td align="center"><input type="radio" name="radio10" id="radio19" value="2" /></td>
            <td align="center"><input type="radio" name="radio10" id="radio19" value="1" /></td>
          </tr>
          <tr>
            <td height="40">&nbsp;11. ภาพประกอบสามารถสื่อความหมายได้
              <input type="hidden"  name="txt11" value="ประเมินหัวข้อ11"/></td>
            <td align="center"><input type="radio" name="radio11" id="radio11" value="5" /></td>
            <td align="center"><input type="radio" name="radio11" id="radio11" value="4" /></td>
            <td align="center"><input type="radio" name="radio11" id="radio11" value="3" /></td>
            <td align="center"><input type="radio" name="radio11" id="radio11" value="2" /></td>
            <td align="center"><input type="radio" name="radio11" id="radio11" value="1" /></td>
          </tr>
        </table>
        <br />
        <table width="792" align="center" height="147" border="1">
          <tr>
            <td width="394" height="35" align="center"><h4>3.ด้านประโยชน์และการนำไปใช้</h4></td>
            <td width="58" align="center">มากที่สุด</td>
            <td width="58" align="center">มาก</td>
            <td width="58" align="center">ปานกลาง</td>
            <td width="58" align="center">น้อย</td>
            <td width="58" align="center">น้อยที่สุด</td>
          </tr>
          <tr>
            <td height="34">&nbsp;12. เนื่้อหามีประโยชน์ต่อผู้ใช้งาน และสามารถนำไปประยุกต์ใช้งาน
              <input type="hidden"  name="txt12" value="ประเมินหัวข้อ12"/></td>
            <td align="center"><input type="radio" name="radio12" id="radio12" value="5" /></td>
            <td align="center"><input type="radio" name="radio12" id="radio12" value="4" /></td>
            <td align="center"><input type="radio" name="radio12" id="radio12" value="3" /></td>
            <td align="center"><input type="radio" name="radio12" id="radio12" value="2" /></td>
            <td align="center"><input type="radio" name="radio12" id="radio12" value="1" /></td>
          </tr>
          <tr>
            <td height="32">&nbsp;13. สามารถเป็นแหล่งความรู้ได้
              <input type="hidden"  name="txt13" value="ประเมินหัวข้อ13"/></td>
            <td align="center"><input type="radio" name="radio13" id="radio13" value="5" /></td>
            <td align="center"><input type="radio" name="radio13" id="radio13" value="4" /></td>
            <td align="center"><input type="radio" name="radio13" id="radio13" value="3" /></td>
            <td align="center"><input type="radio" name="radio13" id="radio13" value="2" /></td>
            <td align="center"><input type="radio" name="radio13" id="radio13" value="1" /></td>
          </tr>
          <tr>
            <td height="34">&nbsp;14. เป็นแหล่งข้อมูลที่ตรงกับความต้องการของผู้ใช้งาน
              <input type="hidden"  name="txt14" value="ประเมินหัวข้อ14"/></td>
            <td align="center"><input type="radio" name="radio14" id="radio14" value="5" /></td>
            <td align="center"><input type="radio" name="radio14" id="radio14" value="4" /></td>
            <td align="center"><input type="radio" name="radio14" id="radio14" value="3" /></td>
            <td align="center"><input type="radio" name="radio14" id="radio14" value="2" /></td>
            <td align="center"><input type="radio" name="radio14" id="radio14" value="1" /></td>
          </tr>
        </table>
        <br />
        <table width="792" align="center" height="40">
          <tr>
            <td width="159">&nbsp;</td>
            <td width="481"><p>ข้อเสนอแนะ <br />
              <textarea name="textarea1" id="textarea1" cols="70" rows="8"/></textarea>
              </textarea>
            </p>
              <p>
                <center>
                  <input type="submit" name="add" value="ส่งแบบประเมิน" />
                </center>
              </p></td>
            <td width="72" align="center">&nbsp;</td>
            <td width="16" align="center">&nbsp;</td>
            <td width="23" align="center">&nbsp;</td>
            <td width="13" align="center">&nbsp;</td>
          </tr>
        </table></td>
    </tr>
  </table>
</form>
</body>
</html>




Tag : PHP







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2016-07-27 15:07:19 By : golfza034 View : 7458 Reply : 6
 

 

No. 1



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

Hall of Fame 2012

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


- 1.5 ใส่ค่า value ด้วยครับ
- textbox hidden ไม่จำเป็นต้องใช้ ไปกำหนดใน ฐานข้อมูลแทน
- insert ใช้รูปแบบธรรมดา อ้างอิงจาก ยกตัวอย่าง
Code (PHP)
$radio1=$_POST['radio1'];
$radio2=$_POST['radio2'];
$radio3=$_POST['radio3'];
$radio4=$_POST['radio4'];
$Result=mysqli_query($con,"INSERT INTO tb_example (UserID,Qus1,Qus2,Qus3,Ques4) VALUES ('".$_SESSION['UserID']."','".$radio1."','".$radio2."','".$radio3."','".radio4."')");







แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2016-07-27 15:26:47 By : dudesaranyu
 


 

No. 2



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

สมาชิกที่ใส่เสื้อไทยครีเอท Hall of Fame 2012

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


หาดีดี ระบบประเมินมีแจกอยู่ครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2016-07-27 15:34:32 By : apisitp
 

 

No. 3



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



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

ตอบความคิดเห็นที่ : 1 เขียนโดย : dudesaranyu เมื่อวันที่ 2016-07-27 15:26:47
รายละเอียดของการตอบ ::
Ok ครับ ถ้าเขียนแบบว่า เมื่อเลือก radio อัน1แล้วให้ดึงค่า แล้วเอามาแสดงใน textbox กำหนดให้ textbox มัน hidden แบบนี้ได้เปล่าครับ

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2016-07-27 15:41:07 By : golfza034
 


 

No. 4



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

Hall of Fame 2012

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


ตอบความคิดเห็นที่ : 3 เขียนโดย : golfza034 เมื่อวันที่ 2016-07-27 15:41:07
รายละเอียดของการตอบ ::
คือผมคิดว่ามันไม่จำเป็นต้องมีก็ได้ครับ เพราะชื่อ Field ใน DB มันบอกอยู่แล้วว่ามาจากข้อไหน

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2016-07-27 15:43:33 By : dudesaranyu
 


 

No. 5



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



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

ตอบความคิดเห็นที่ : 2 เขียนโดย : apisitp เมื่อวันที่ 2016-07-27 15:34:32
รายละเอียดของการตอบ ::
ครับผม

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2016-07-27 15:43:53 By : golfza034
 


 

No. 6



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



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

ตอบความคิดเห็นที่ : 1 เขียนโดย : dudesaranyu เมื่อวันที่ 2016-07-27 15:26:47
รายละเอียดของการตอบ ::
ได้ ล่ะ ครับ ขอบคุณ ครับผม

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2016-07-27 15:53:37 By : golfza034
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : ถามเรื่อง แบบประเมินหน่อยครับ อยากบันทึกลงในฐานข้อมูล ต้องเขียนโค้ดยังไงครับ
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ 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 อัตราราคา คลิกที่นี่