|
|
|
ช่วยด้วยเพิ่มข้อมูลใน form แล้ว ไม่ลงในฐานข้อมูลครับ |
|
|
|
|
|
|
|
กรอกข้อมูลลงใน form แล้วไม่บันทึกลงฐานข้อมูลไม่รู้ว่า code ผิดตรงไหนรบกวนด้วยครับ
Code (PHP)
<html>
<head>
<title>Ãкº¢éÍÁÙźؤÅÒ¡ÃÍ͹äÅ·ì</title>
<meta http-equiv="Content-Type" content="text/html; charset=tis-620">
<script language="JavaScript" type="text/javascript">
<!--
function checkform ( form )
{
if (form.name.value == "") {
alert( "â»Ã´¡ÃÍ¡ ª×èÍ-¹ÒÁÊ¡ØÅ ´éÇÂ" );
form.name.focus();
return false ;
}
if (form.cid.value == "") {
alert( "â»Ã´¡ÃÍ¡ËÁÒÂàÅ¢ºÑµÃ»ÃЪҪ¹¤ÃѺ" );
form.cid.focus();
return false ;
}
if (form.year.value == "") {
alert( "â»Ã´¡ÃÍ¡»Õ ¾.È." );
form.year.focus();
return false ;
}
if (form.address.value == "") {
alert( "â»Ã´¡ÃÍ¡·ÕèÍÂÙè»Ñ¨¨ØºÑ¹´éǤÃѺ" );
form.address.focus();
return false ;
}
if (form.degree.value == "") {
alert( "â»Ã´¡ÃÍ¡ÇزԡÒÃÈÖ¡ÉÒ" );
form.degree.focus();
return false ;
}
if (form.major.value == "") {
alert( "â»Ã´¡ÃÍ¡ ÊÒ¢Ò ÇÔªÒàÍ¡" );
form.major.focus();
return false ;
}
if (form.position.value == "") {
alert( "â»Ã´¡ÃÍ¡µÓá˹è§" );
form.position.focus();
return false ;
}
if (form.address_w.value == "") {
alert( "â»Ã´¡Ã͡ʶҹ·Õè·Ó§Ò¹" );
form.address_w.focus();
return false ;
}
return true ;
}
-->
</script>
<style>
BODY {
FONT-FAMILY: Arial, Helvetica, sans-serif
}
</style>
</head>
<body bgcolor="#FFFFFF">
<div align="center"><img src="images/nfe.png" width=100 height=100></div>
<div align="center"><font color="#0033CC" size="4">Ãкº¢éÍÁÙźؤÅÒ¡ÃÍ͹äÅ·ì <br>
Êӹѡ§Ò¹ ¡È¹.¨Ñ§ËÇÑ´ÍغÅÃÒª¸Ò¹Õ
</font></div>
<p>
<font color="#FF0033" size="2"><div align="center">*** ¡ÃسҡÃÍ¡¢éÍÁÙźؤÅÒ¡ÃãËé¤Ãº¶éǹ ***</div></font>
</p>
<!-- ÊèǹËÑǢͧ¿ÍÃìÁ·Õèà»ç¹¡Òú͡ÇèÒ¨ÐãËéä»Ë¹éÒä˹ ËÅѧ¡´»ØèÁ Submit -->
<form action="form_in.php" method="post" onsubmit="return checkform(this);" >
<table border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#993333">
<td><font color="#FFFFFF">
¢éÍÁÙÅÊèǹµÑÇ
</td>
<tr>
<td bgcolor="#FFFFFF"><p><font size="2">
ª×èÍ - ¹ÒÁÊ¡ØÅ </font></p></td>
<td bgcolor="#FFFFFF">
<select name="fn" >
<option>¤Ó¹Ó˹éÒ</option>
<option value="¹ÒÂ">¹ÒÂ</option>
<option value="¹Ò§ÊÒÇ">¹Ò§ÊÒÇ</option>
<option value="¹Ò§">¹Ò§</option>
</select>
<input name="name" type="text" size="30" style="width: 100px" maxlength="100">
<input name="fname" type="text" size="30" style="width: 100px" maxlength="100"></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><p><font size="2">
ËÁÒÂàÅ¢ºÑµÃ»ÃЪҪ¹</font></td>
<td bgcolor="#FFFFFF">
<input name="cid" type="text" size="30" style="width: 100px" maxlength="13"><font color="#FF0000">***</td>
</tr>
<tr>
<td bgcolor="#FFFFFF"> <font size="2"> Çѹ·Õèà´×͹»Õà¡Ô´</font></td>
<td bgcolor="#FFFFFF"><font size="2">Çѹ·Õè
<select name="date">
<option value=1 selected>1</option>
<option value=2>2</option>
<option value=3>3</option>
<option value=4>4</option>
<option value=5>5</option>
<option value=6>6</option>
<option value=7>7</option>
<option value=8>8</option>
<option value=9>9</option>
<option value=10>10</option>
<option value=11>11</option>
<option value=12>12</option>
<option value=13>13</option>
<option value=14>14</option>
<option value=15>15</option>
<option value=16>16</option>
<option value=17>17</option>
<option value=18>18</option>
<option value=19>19</option>
<option value=20>20</option>
<option value=21>21</option>
<option value=22>22</option>
<option value=23>23</option>
<option value=24>24</option>
<option value=25>25</option>
<option value=26>26</option>
<option value=27>27</option>
<option value=28>28</option>
<option value=29>29</option>
<option value=30>30</option>
<option value=31>31</option>
</select>
à´×͹
<select name="month">
<option value="1" selected>Á¡ÃÒ¤Á</option>
<option value=2>¡ØÁÀҾѹ¸ì</option>
<option value=3>ÁÕ¹Ò¤Á</option>
<option value=4>àÁÉÒ¹</option>
<option value=5>¾ÄÉÀÒ¤Á</option>
<option value=6>ÁԶعÒ¹</option>
<option value=7>¡Ã¡®Ò¤Á</option>
<option value=8>ÊÔ§ËÒ¤Á</option>
<option value=9>¡Ñ¹ÂÒ¹</option>
<option value=10>µØÅÒ¤Á</option>
<option value=11>¾ÄȨԡÒ¹</option>
<option value=12>¸Ñ¹ÇÒ¤Á</option>
</select>
¾.È.
<input name="year" type="text" size="5" maxlength="5">
</font></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><font size="2"> ʶҹÐÀÒ¾</font></td>
<td bgcolor="#FFFFFF"><font size="2">
<input name="s_marry" type="radio" value="âÊ´" checked>
âÊ´
<input name="s_marry" type="radio" value="ÊÁÃÊ" checked>
ÊÁÃÊ
<input name="s_marry" type="radio" value= "ËÂèÒÃéÒ§"> ËÂèÒÃéÒ§</font>
</tr>
<tr>
<td bgcolor="#FFFFFF"><p><font size="2">
ª×èÍ - ¹ÒÁÊ¡ØÅ ¤ÙèÊÁÃÊ</font></p></td>
<td bgcolor="#FFFFFF">
<input name="marryname" type="text" size="30" style="width: 227px" maxlength="100"></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><p><font size="2">
¨Ó¹Ç¹ºØµÃ</font></p></td>
<td bgcolor="#FFFFFF">
<font size="2" ><input name="child" type="text" size="30" style="width: 100px" maxlength="100">¤¹</font></td>
<tr>
<td bgcolor="#FFFFFF"><font size="2"> ·ÕèÍÂÙè»Ñ¨¨ØºÑ¹</font></td>
<td bgcolor="#FFFFFF"><font size="2">
<textarea name="address" cols="20" rows="2" wrap="virtual"></textarea>
</font></td>
<tr>
<td bgcolor="#FFFFFF"><p><font size="2">
ËÁÒÂàÅ¢â·ÃÈѾ·ì</font></p></td>
<td bgcolor="#FFFFFF">
<input name="phone" type="text" size="30" style="width: 100px" maxlength="10"></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><p><font size="2">
ÍÕàÁÅì</font></p></td>
<td bgcolor="#FFFFFF">
<input name="mail" type="text" size="30" style="width: 180px" maxlength="100"></td>
</tr>
<td><font color="#FFFFFF">
»ÃÐÇѵԡÒÃÈÖ¡ÉÒ
</td>
<tr>
<td bgcolor="#FFFFFF"><p><font size="2">
ÇزԡÒÃÈÖ¡ÉÒÊÙ§ÊØ´</font></p></td>
<td bgcolor="#FFFFFF">
<input name="degree" type="text" size="30" style="width: 120px" maxlength="60"> <font color="#FF0033" size="2">àªè¹ Ç·.º ¤º. ¡È.º.</font></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><p><font size="2">
ÇÔªÒàÍ¡/ÊÒ¢ÒÇÔªÒ</font></p></td>
<td bgcolor="#FFFFFF">
<input name="major" type="text" size="30" style="width: 150px" maxlength="100"> <font color="#FF0033" size="2">àªè¹ ÇÔ·ÂÒ¡ÒäÍÁ¾ÔÇàµÍÃì </font></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><p><font size="2">
ʶҺѹ/ÁËÒÇÔ·ÂÒÅÑÂ</font></p></td>
<td bgcolor="#FFFFFF">
<input name="institute" type="text" size="30" style="width: 150px" maxlength="100"> </td>
</tr>
<tr>
<td bgcolor="#FFFFFF"> <font size="2">   Çѹ·Õ診¡ÒÃÈÖ¡ÉÒ</font></td>
<td bgcolor="#FFFFFF"><font size="2">Çѹ·Õè
<select name="date2">
<option value=1 selected>1</option>
<option value=2>2</option>
<option value=3>3</option>
<option value=4>4</option>
<option value=5>5</option>
<option value=6>6</option>
<option value=7>7</option>
<option value=8>8</option>
<option value=9>9</option>
<option value=10>10</option>
<option value=11>11</option>
<option value=12>12</option>
<option value=13>13</option>
<option value=14>14</option>
<option value=15>15</option>
<option value=16>16</option>
<option value=17>17</option>
<option value=18>18</option>
<option value=19>19</option>
<option value=20>20</option>
<option value=21>21</option>
<option value=22>22</option>
<option value=23>23</option>
<option value=24>24</option>
<option value=25>25</option>
<option value=26>26</option>
<option value=27>27</option>
<option value=28>28</option>
<option value=29>29</option>
<option value=30>30</option>
<option value=31>31</option>
</select>
à´×͹
<select name="month2">
<option value="1" selected>Á¡ÃÒ¤Á</option>
<option value=2>¡ØÁÀҾѹ¸ì</option>
<option value=3>ÁÕ¹Ò¤Á</option>
<option value=4>àÁÉÒ¹</option>
<option value=5>¾ÄÉÀÒ¤Á</option>
<option value=6>ÁԶعÒ¹</option>
<option value=7>¡Ã¡®Ò¤Á</option>
<option value=8>ÊÔ§ËÒ¤Á</option>
<option value=9>¡Ñ¹ÂÒ¹</option>
<option value=10>µØÅÒ¤Á</option>
<option value=11>¾ÄȨԡÒ¹</option>
<option value=12>¸Ñ¹ÇÒ¤Á</option>
</select>
¾.È.
<input name="year2" type="text" size="5" maxlength="5">
</font></td>
</tr>
<td><font color="#FFFFFF">
ʶҹ·Õè·Ó§Ò¹
</td>
<tr>
<td bgcolor="#FFFFFF"><p><font size="2">
µÓá˹è§</font></p></td>
<td bgcolor="#FFFFFF">
<select name="position" id="positon">
<option>¡ÃسÒàÅ×Í¡µÓá˹è§</option>
<option value="¼ÙéÍӹǡÒÃÊӹѡ§Ò¹ ¡È¹.¨Ñ§ËÇÑ´">¼ÙéÍӹǡÒÃÊӹѡ§Ò¹ ¡È¹.¨Ñ§ËÇÑ´</option>
<option value="Ãͧ¼ÙéÍӹǡÒÃÊӹѡ§Ò¹ ¡È¹.¨Ñ§ËÇÑ´">Ãͧ¼ÙéÍӹǡÒÃÊӹѡ§Ò¹ ¡È¹.¨Ñ§ËÇÑ´</option>
<option value="¼ÙéÍӹǡÒà ¡È¹.ÍÓàÀÍ">¼ÙéÍӹǡÒà ¡È¹.ÍÓàÀÍ</option>
<option value="¤ÃÙªÓ¹Ò¡ÒþÔàÈÉ">¤ÃÙªÓ¹Ò¡ÒþÔàÈÉ</option>
<option value="¤ÃÙªÓ¹Ò¡ÒÃ">¤ÃÙªÓ¹Ò¡ÒÃ</option>
<option value="¤ÃÙ">¤ÃÙ</option>
<option value="ºÃóÒÃѡɪӹҡÒÃ">ºÃóÒÃÑ¡ÉìªÓ¹Ò¡ÒÃ</option>
<option value="ºÃóÒÃÑ¡Éì">ºÃóÒÃÑ¡Éì</option>
<option value="¾¹Ñ¡§Ò¹¾ÔÁ¾ì´Õ´ªÑé¹ 1">¾¹Ñ¡§Ò¹¾ÔÁ¾ì´Õ´ªÑé¹ 1</option>
<option value="¾¹Ñ¡§Ò¹¾ÔÁ¾ì´Õ´ªÑé¹ 2">¾¹Ñ¡§Ò¹¾ÔÁ¾ì´Õ´ªÑé¹ 3</option>
<option value="¹Ñ¡ÇÔà¤ÃÒÐËì¹âºÒÂáÅÐá¼¹">¹Ñ¡ÇÔà¤ÃÒÐËì¹âºÒÂáÅÐá¼¹</option>
<option value="¹Ñ¡ÇÔªÒ¡ÒäÍÁ¾ÔÇàµÍÃì">¹Ñ¡ÇÔªÒ¡ÒäÍÁ¾ÔÇàµÍÃì</option>
<option value="¹Ñ¡ÇÔªÒ¡ÒÃÈÖ¡ÉÒ">¹Ñ¡ÇÔªÒ¡ÒÃÈÖ¡ÉÒ</option>
<option value="¹Ñ¡¡ÒèѴ¡Ò÷ÑèÇä»">¹Ñ¡¡ÒèѴ¡Ò÷ÑèÇä»</option>
<option value="¹Ñ¡ÇÔªÒ¡ÒþÑÊ´Ø">¹Ñ¡ÇÔªÒ¡ÒþÑÊ´Ø</option>
<option value="¹Ñ¡ÇÔªÒ¡ÒÃà§Ô¹áÅкѪÕ">¹Ñ¡ÇÔªÒ¡ÒÃà§Ô¹áÅкѪÕ</option>
<option value="¾¹Ñ¡§Ò¹ÃÒª¡ÒÃ">¾¹Ñ¡§Ò¹ÃÒª¡ÒÃ(¤ÃÙÍÒÊÒ)</option>
<option value="¾¹Ñ¡§Ò¹ÃÒª¡ÒÃ">¾¹Ñ¡§Ò¹ÃÒª¡Òà (¤ÃÙ Èê.) </option>
<option value="¤ÃÙÊ͹¤¹¾Ô¡ÒÃ">¤ÃÙÊ͹¤¹¾Ô¡ÒÃ</option>
<option value="¤ÃÙ »Çª.">¤ÃÙ »Çª.</option>
<option value="¤ÃÙÊ͹à´ç¡àÃèÃè͹">¤ÃÙÊ͹à´ç¡àÃèÃè͹</option>
<option value="¾¹Ñ¡§Ò¹ÃÒª¡ÒÃ">¾¹Ñ¡§Ò¹ºÃÔ¡ÒÃ</option>
<option value="¾¹Ñ¡§Ò¹ÃÒª¡ÒÃ">¾¹Ñ¡§Ò¹¢ÑºÃ¶Â¹µì </option>
</select> </td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><p><font size="2">
˹èǧҹ</font></p></td>
<td bgcolor="#FFFFFF">
<div align="left">
<select name="dept" id="dept">
<option>¡ÃسÒàÅ×͡˹èǧҹ</option>
<option value="¡È¹.ÍÓàÀÍàÁ×ͧ">¡È¹.ÍÓàÀÍàÁ×ͧ</option>
<option value="¡È¹.ÍÓàÀÍ¡Ø´¢éÒÇ»Øé¹">¡È¹.ÍÓàÀÍ¡Ø´¢éÒÇ»Øé¹</option>
<option value="¡È¹.à¢ÁÃÒ°">¡È¹.ÍÓàÀÍà¢ÁÃÒ°</option>
<option value="¡È¹.ÍÓàÀÍà¢×èͧã¹">¡È¹.ÍÓàÀÍà¢×èͧã¹</option>
<option value="¡È¹.ÍÓàÀÍ⢧à¨ÕÂÁ">¡È¹.ÍÓàÀÍ⢧à¨ÕÂÁ</option>
<option value="¡È¹.ÍÓàÀʹ͹Á´á´§">¡È¹.ÍÓàÀʹ͹Á´á´§</option>
<option value="¡È¹.ÍÓàÀÍà´ªÍØ´Á">¡È¹.ÍÓàÀÍà´ªÍØ´Á</option>
<option value="¡È¹.ÍÓàÀ͵ÃСÒþת¼Å">¡È¹.ÍÓàÀ͵ÃСÒþת¼Å</option>
<option value="¡È¹.ÍÓàÀ͵ÒÅÊØÁ">¡È¹.ÍÓàÀ͵ÒÅÊØÁ</option>
<option value="¡È¹.ÍÓàÀ͹ҨÐËÅÇÂ">¡È¹.ÍÓàÀ͹ҨÐËÅÇÂ</option>
<option value="¡È¹.ÍÓàÀÍ·Øè§ÈÃÕÍØ´Á">¡È¹.ÍÓàÀÍ·Øè§ÈÃÕÍØ´Á</option>
<option value="¡È¹.ÍÓàÀ͹ҵÒÅ">¡È¹.ÍÓàÀ͹ҵÒÅ</option>
<option value="¡È¹.ÍÓàÀ͹ÒàÂÕÂ">¡È¹.ÍÓàÀ͹ÒàÂÕÂ</option>
<option value="¡È¹.ÍÓàÀ͹éÓ¢Øè¹">¡È¹.ÍÓàÀ͹éÓ¢Øè¹</option>
<option value="¡È¹.ÍÓàÀ͹éÓÂ×¹">¡È¹.ÍÓàÀ͹éÓÂ×¹</option>
<option value="¡È¹.ÍÓàÀͺس±ÃÔ¡">¡È¹.ÍÓàÀͺس±ÃÔ¡</option>
<option value="¡È¹.ÍÓàÀ;ԺÙÅÏ">¡È¹.ÍÓàÀ;ԺÙÅÏ</option>
<option value="¡È¹.ÍÓàÀÍ⾸Ôìä·Ã">¡È¹.ÍÓàÀÍ⾸Ôìä·Ã</option>
<option value="¡È¹.ÍÓàÀÍÁèǧÊÒÁÊÔº">¡È¹.ÍÓàÀÍÁèǧÊÒÁÊÔº</option>
<option value="¡È¹.ÍÓàÀÍÇÒÃÔ¹ªÓÃÒº">¡È¹.ÍÓàÀÍÇÒÃÔ¹ªÓÃÒº</option>
<option value="¡È¹.ÍÓàÀÍÈÃÕàÁ×ͧãËÁè">¡È¹.ÍÓàÀÍÈÃÕàÁ×ͧãËÁè</option>
<option value="¡È¹.ÍÓàÀÍÊÇèÒ§ÇÕÃÐǧ¤ì">¡È¹.ÍÓàÀÍÊÇèÒ§ÇÕÃÐǧ¤ì</option>
<option value="¡È¹.ÍÓàÀÍÊÓâç">¡È¹.ÍÓàÀÍÊÓâç</option>
<option value="¡È¹.ÍÓàÀÍÊÔÃÔ¹¸Ã">¡È¹.ÍÓàÀÍÊÔÃÔ¹¸Ã</option>
<option value="¡È¹.ÍÓàÀÍàËÅèÒàÊ×Íâ¡é¡">¡È¹.ÍÓàÀÍàËÅèÒàÊ×Íâ¡é¡</option>
<option value="Êӹѡ§Ò¹ ¡È¹.¨Ñ§ËÇÑ´ÍغÅÃÒª¸Ò¹Õ">Êӹѡ§Ò¹ ¡È¹.¨Ñ§ËÇÑ´ÍغÅÃÒª¸Ò¹Õ</option>
</select>
</div></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"> <font size="2">   Çѹ·Õèà¢éÒºÃèØ</font></td>
<td bgcolor="#FFFFFF"><font size="2">Çѹ·Õè
<select name="date3">
<option value=1 selected>1</option>
<option value=2>2</option>
<option value=3>3</option>
<option value=4>4</option>
<option value=5>5</option>
<option value=6>6</option>
<option value=7>7</option>
<option value=8>8</option>
<option value=9>9</option>
<option value=10>10</option>
<option value=11>11</option>
<option value=12>12</option>
<option value=13>13</option>
<option value=14>14</option>
<option value=15>15</option>
<option value=16>16</option>
<option value=17>17</option>
<option value=18>18</option>
<option value=19>19</option>
<option value=20>20</option>
<option value=21>21</option>
<option value=22>22</option>
<option value=23>23</option>
<option value=24>24</option>
<option value=25>25</option>
<option value=26>26</option>
<option value=27>27</option>
<option value=28>28</option>
<option value=29>29</option>
<option value=30>30</option>
<option value=31>31</option>
</select>
à´×͹
<select name="month3">
<option value="1" selected>Á¡ÃÒ¤Á</option>
<option value=2>¡ØÁÀҾѹ¸ì</option>
<option value=3>ÁÕ¹Ò¤Á</option>
<option value=4>àÁÉÒ¹</option>
<option value=5>¾ÄÉÀÒ¤Á</option>
<option value=6>ÁԶعÒ¹</option>
<option value=7>¡Ã¡®Ò¤Á</option>
<option value=8>ÊÔ§ËÒ¤Á</option>
<option value=9>¡Ñ¹ÂÒ¹</option>
<option value=10>µØÅÒ¤Á</option>
<option value=11>¾ÄȨԡÒ¹</option>
<option value=12>¸Ñ¹ÇÒ¤Á</option>
</select>
¾.È.
<input name="year3" type="text" size="5" maxlength="5">
</font></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><p><font size="2">
àÅ¢·Õèà§Ô¹à´×͹</font></p></td>
<td bgcolor="#FFFFFF">
<input name="num_salary" type="text" size="30" style="width: 100px" maxlength="100"></td>
</tr>
<tr bgcolor="#FFFFCC">
<td colspan="2">
<div align="center">
<input type="submit" name="Submit" value="Ê觢éÍÁÙÅ">
<input type="reset" name="Reset" value="ź¢éÍÁÙÅ">
</div></td>
</tr>
</table>
</form>
<?php include("footer.php")?>
</body>
</html>
form_in.php
Code (PHP)
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=tis-620">
<title>:: Ãкº¢éÍÁÙźؤÅÒ¡ÃÍ͹äÅ·ì ::</title>
<style>
BODY {
FONT-FAMILY: Arial, Helvetica, sans-serif
}
</style>
</head>
<body >
<div align="center"><img src="images/nfe.png" width=100 height=100></div>
<center><font color="#0000CC" size="3">Ãкº¢éÍÁÙźؤÅÒ¡ÃÍ͹äÅ·ì<br>
Êӹѡ§Ò¹ ¡È¹.¨Ñ§ËÇÑ´ÍغÅÃÒª¸Ò¹Õ
</font></center>
<?php
include("connect.php"); // µéͧ·Ó¡Òà Include ä¿Åì·Õèà»ç¹¡ÒõÑ駤èÒ¡ÒõԴµèÍ°Ò¹¢éÍÁÙÅà¢éÒÁÒ´éÇÂ
$result1 = mysql_db_query("$dbname","insert into tb_name values('','$cid','$fn','$name','$fname')");
$result2 = mysql_db_query("$dbname","insert into tb_person values('','$date','$month','$year','$s_marry','$marryname','$child','$address','$phone','$mail')");
$result3 =mysql_db_query("$dbname","insert into tb_education values('','$degree','$major','$institute','$date2','$month2','$year2')");
$result4 =mysql_db_query("$dbname","insert into tb_work values('','$date3','$month3','$year3','$dept','$position','$num_salary')");
if($result4>=1) {
echo "<center>à¾ÔèÁ¢éÍÁÙÅÊÓàÃç¨<br><br> <a href=\"showdata.php\">µ¡Å§</a> </center>";
}
else
{
echo "<center>à¾ÔèÁ¢éÍÁÙÅäÁèÊÓàÃç¨<br><br> <a href=\"form.php\">µ¡Å§</a> </center>";
}
?>
</body>
</html>
Tag : PHP, MySQL
|
|
|
|
|
|
Date :
2011-07-26 13:35:53 |
By :
tossa |
View :
1058 |
Reply :
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
บรรทัดนี้ของไฟล์ include("connect.php"); คือติดต่อกับ Database แล้วใช่ไหมครับ
เอ ที่ไฟล์ form_in.php เหมือนยังไม่ได้ทำการรับค่า POST จาก form ในไฟล์แรกรึเปล่าครับ
การรับค่า POST ใส่ตัวแปรในหน้านี้ให้ครบก่อนครับ เช่น SQL แรก
$name = $_POST['name'];
$fname = $_POST['fname'];
$cid = $_POST['cid'];
$fn = $_POST['fn'];
$result1 = mysql_db_query("$dbname","insert into tb_name values('','$cid','$fn','$name','$fname')");
|
|
|
|
|
Date :
2011-07-26 14:58:29 |
By :
chaiyapk |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|