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,028

HOME > PHP > PHP Forum > list menu ต้องการให้ค่าที่โชว์มันออกมาเป็นค่าของตัวแปรนั้นครับ(เชิญข้างใน)



 

list menu ต้องการให้ค่าที่โชว์มันออกมาเป็นค่าของตัวแปรนั้นครับ(เชิญข้างใน)

 



Topic : 116309



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



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




ส่วนของโค๊ดครับ ออกแล้วแต่ค่าที่แสดงมันเป็นค่าของ id มันไม่เป็นค่าที่ต้องการอ่ะครับ
Code (PHP)
<?
session_start();
	include "config.inc.php";
		if($valid_admin==""){
		header ("Location: admin.php");
		exit();
	}
include "config.inc.php";
$con2 = mysql_connect($host,$username,$password);
if (!$con2)
  {    die('Could not connect: ' . mysql_error());    }
mysql_select_db($database, $con2);
mysql_query("SET NAMES UTF8");
$result2 = mysql_query("SELECT * FROM employee_depart");
$con3 = mysql_connect($host,$username,$password);
if (!$con3)
  {    die('Could not connect: ' . mysql_error());    }
mysql_select_db($database, $con3);
mysql_query("SET NAMES UTF8");
$result3 = mysql_query("SELECT * FROM employee_type");
?>
<!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">
.style1 {color: #FF0000}
</style>
</head>

<body>
<table width="200" border="1" align="center">
  <tr>
    <th>
<table width="1027" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td colspan="2"><img src="pic/index_01.jpg" width="1024" height="224" /></td>
  </tr>
  <tr>
    <td width="240" rowspan="2" valign="top"><table width="235" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <th width="235" scope="col"><img src="pic/index1367_02.jpg" width="236" height="69" /></th>
      </tr>
      <tr>
        <td><a href="employee_detail_list.php"><img src="pic/index1367_04.jpg" width="236" height="43" /></a></td>
      </tr>
      <tr>
        <td><a href="employee_ot_list.php"><img src="pic/index1367_08.jpg" width="236" height="47" /></a></td>
      </tr>
      <tr>
        <td><a href="admin_detail_apply.php"><img src="pic/index1367_09.jpg" width="236" height="46" /></a></td>
      </tr>
      <tr>
        <td><a href="showapply_new.php"><img src="pic/index1367_10.jpg" width="236" height="50" /></a></td>
      </tr>
      <tr>
        <td><a href="train_open.php"><img src="pic/index1367_11.jpg" width="236" height="50" /></a></td>
      </tr>
      <tr>
        <td><img src="pic/index1367_12.jpg" width="236" height="25" /></td>
      </tr>
    </table></td>
    <td width="788" height="73"><img src="pic/h4.jpg" alt="" width="779" height="62" /></td>
  </tr>
  <tr>
    <td><table width="787" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <th width="480" scope="col"><img src="pic/index1367_122.jpg" width="480" height="32" /></th>
        <th width="308" scope="col"><img src="pic/index_05.jpg" width="308" height="32" /></th>
      </tr>
      <tr>
        <td colspan="2"><img src="pic/index_06.jpg" width="788" height="10" /></td>
        </tr>
        <tr>
      <td height="28" colspan="2" align="center" background="pic/Untitled-1.jpg">
      
      <table width="200" border="0" align="right" cellpadding="0" cellspacing="0">
        <tr>
          <th scope="col"><a href="admin_logout.php">ออกจากระบบ</a></th>
        </tr>
      </table></td>
      </tr>
      <tr>
        <td colspan="2" background="pic/Untitled-1.jpg">
        <form action="insert_newsapply.php" method="post" enctype="multipart/form-data" name="form1" id="form1" onsubmit="return check2()">
  <fieldset>
    <legend></legend>
    <table width="615" border="0" align="center" cellpadding="4" cellspacing="2">
      <tr>
        <td colspan="2" align="right" bgcolor="#CCCCCC">&nbsp;</td>
        </tr>
      <tr>
        <td width="229" align="right" bgcolor="#EAEAEA">เลือกแผนกที่รับสมัคร :</td>
        <td width="364" align="left" bgcolor="#EAEAEA"><label for="select"></label>
        <select name="id_depart">
        <? while($row2 = mysql_fetch_array($result2))
  { ?>
		<option value='<?=$row2['id_depart']?>'><?=$row2['type_depart']?></option>
  <? } ?>
      </select></td>
      </tr>
      <tr>
        <td align="right" bgcolor="#EAEAEA">เลือกตำแหน่งที่รับสมัคร :</td>
        <td align="left" bgcolor="#EAEAEA"><label for="select"></label>
        <select name="id_employee_type" onchange="form1.detail_type.value=this.value">
        <? while($row3 = mysql_fetch_array($result3))
  { ?>
		<option value='<?=$row3['id_employee_type']?>' value='<?=$row3['detail_type']?>'><?=$row3['type_employee']?></option>
  <? } ?>
      </select></td>
      </tr>
      <tr>
        <td align="right" valign="top" bgcolor="#EAEAEA">รายละเอียดการรับสมัคร :</td>
        <td bgcolor="#EAEAEA"><textarea name="detail_type" cols="50" rows="5" id="detail_type" ></textarea></td>
      </tr>


ผมต้องการให้แสดง ค่าของ detail_type แต่ที่มันออกเป็นค่าของ id_employee_type ผมต้องแก้ยังไงครับ



Tag : PHP







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2015-05-07 20:52:33 By : narongsad View : 528 Reply : 2
 

 

No. 1



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



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

Code (PHP)
<option value='<?=$row3['id_employee_type']?>'><?=$row3['detail_type']?></option>


ผมไม่รู้นะครับ ทำไมถึงมี attr "value" 2 อันใน option อันเก่าของคุณ แต่ผมแก้แบบนี้น่าจะได้แล้วนะครับ








ประวัติการแก้ไข
2015-05-07 22:28:49
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-05-07 22:27:32 By : ppanchai
 


 

No. 2



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



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


ตอบความคิดเห็นที่ : 1 เขียนโดย : ppanchai เมื่อวันที่ 2015-05-07 22:27:32
รายละเอียดของการตอบ ::
อ้อโทษทีครับผมลืมลบจริงๆ ลบลองดูเฉยๆ ยังออกเป็นไอดีเหมือนเดิมครับ

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-05-08 02:07:08 By : narongsad
 

   

ค้นหาข้อมูล


   
 

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