|
![](/images/resource/spacer.gif) |
|
จะเรียกใช้ fuction php ผ่านคำสั่ง javascript ยังไงดีครับ เข้ามาดูรายละเอียดก่อนนะครับ |
|
![](/images/resource/viewboard_01.gif?v=1001) |
|
|
![](/images/resource/viewboard_03.gif?v=1001) |
![](/images/resource/viewboard_04.gif?v=1001) |
|
เขียนให้เป็นแนวทางนะ
Code (PHP)
function clickRead(id,readStatus){
$.post("action.php",{id:id,readStatus:readStatus,ac:'upstatus'},function(data){
if(data==''){
$('.showData').load('message.php');
}else{
alert('Error Update');return false;
}
});
}
<div class="showData">
//loop sql message เอานะ
<a href="javascript:void(0);" onclick="javascript:clickRead(1,'yes')"></a>
</div>
//action.php
$id=$_POST['id'];
$readStatus=$_POST['readStatus'];
$q=mysql_query("update xxxxxxxxxxxxxxxxxxxxx");
if($q){
echo'';exit();
}else{
echo'NO';exit();
}
|
ประวัติการแก้ไข 2015-01-14 22:08:03
![](/images/resource/blockviewtopic_01.gif?v=1001) |
![](/images/resource/blockviewtopic_02.gif?v=1001) |
![](/images/resource/blockviewtopic_03.gif?v=1001) |
![](/images/resource/blockviewtopic_04.gif?v=1001) |
Date :
2015-01-14 22:07:30 |
By :
somparn |
|
![](/images/resource/blockviewtopic_06.gif?v=1001) |
![](/images/resource/blockviewtopic_07.gif?v=1001) |
![](/images/resource/blockviewtopic_08.gif?v=1001) |
![](/images/resource/blockviewtopic_09.gif?v=1001) |
|
|
![](/images/resource/viewboard_06.gif?v=1001) |
![](/images/resource/viewboard_07.gif?v=1001) |
|
![](/images/resource/viewboard_08.jpg?v=1001) |
![](/images/resource/viewboard_09.gif?v=1001) |
|
|
|
![](/images/digitalocean-banner.jpg)
|
Load balance : Server 02
|