|
 |
|
ช่วยดูcodeไห้ หน่อย คับ ผมรับค่ามาเก็ยแล้วคับ ต้องจะนำค่าออกมาแสดงในอีกform ทำไงอ่ะคับ |
|
 |
|
|
 |
 |
|
ไม่รู้ว่าจะตรงความต้องการรึเปล่านะครับ ลองเอาไปปรับแต่งดูนะครับ
ผมก็มือใหม่ด้วย แต่อยากจะมีส่วนร่วมนะครับ 
add.php
<form action="save.php" method="post" enctype="multipart/form-data" name="form1" id="frmpro" onSubmit="return checkpro()">
<table width="384" border="1" align="center" cellpadding="1" cellspacing="0">
<tr>
<td colspan="2"><div align="center" class="style25">
<p> </p>
</div></td>
</tr>
<tr>
<td class="style1"><div align="right" class="style20"> topic : </div></td>
<td width="277"><div align="left">
<label> </label>
<input name="topic" type="text" id="topic" />
</div></td>
</tr>
<tr>
<td width="188" class="style1"><div align="right" class="style20"> dital : </div></td>
<td><div align="left">
<label></label>
<input name="dital" type="text" id="dital" />
</div></td>
</tr>
<tr>
<td><p> </p>
<p> </p></td>
<td><label>
<input type="submit" name="Submit" value="บันทึก" />
<input type="reset" name="Submit2" value="ยกเลิก" />
</label></td>
</tr>
</table>
</form>
save.php
<?
$objConnect = mysql_connect("localhost","root","123456") or die("Error Connect to Database");
$objDB = mysql_select_db("board");
$strSQL = "INSERT INTO employee ";
$strSQL .="(id,topic,dital)";
$strSQL .="VALUES";
$strSQL .="('".$_POST["id"]."','".$_POST["topic"]."','".$_POST["dital"]."') ";
$objQuery = mysql_query($strSQL);
}
if($objQuery)
{
echo "<br><br><br><center>คุณได้ลงทะเบียนเรียบร้อยแล้ว <br> กรุณารอสักครู่ </center>";
echo "<meta http-equiv=refresh content=3;URL=view.php>";
}
?>
view.php
<?
$objConnect = mysql_connect("localhost","root","123456") or die("Error Connect to Database");
$objDB = mysql_select_db("board");
$strSQL = "SELECT * FROM employee ORDER BY id DESC ";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
$objResult = mysql_fetch_array($objQuery);
?>
<style type="text/css">
<!--
.style2 {font-family: Tahoma; font-size: 14px; }
-->
</style>
<table width="213" height="53" border="1" align="center">
<tr>
<td width="30"><div align="center" class="style2">id</div></td>
<td width="77"><div align="center" class="style2">topic</div></td>
<td width="84"><div align="center" class="style2">dital</div></td>
</tr>
<tr>
<td><div align="center"><? echo $objResult["id"];?> </div></td>
<td><div align="center"><? echo $objResult["topic"];?></div></td>
<td><div align="center"><? echo $objResult["dital"];?></div></td>
</tr>
</table>
|
 |
 |
 |
 |
Date :
2011-10-02 16:59:23 |
By :
ZerzaCub |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
while($row=mysql_fetch_array($result1))
{
$topic=$row["topic"];
$dital=$row["dital"];
echo 'ข้อความที่ต้องการ'.$topic."</br>";
echo 'ข้อความที่ต้องการ'.$dital."</br>";
echo"<hr><br>";
}
|
 |
 |
 |
 |
Date :
2011-10-02 17:01:04 |
By :
arm8957 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 00
|