我想創建一種請求,其中註冊成員可以查看其他註冊成員的帖子。他們可能會選擇與他們聯繫,然後才能對帖子發表評論。我想要的是使用jQuery將請求發送到PHP,然後將其插入數據庫,狀態爲connection requested
。當成員看到請求時,他可以選擇接受或拒絕該請求。如果他接受,狀態將更改爲you are connected with this member
。通過jQuery發送變量到PHP並返回
請讓我知道有類似的問題,但不完全如我的,有人應該請幫忙。
'cont_email' is email of member sending request
'email_cont' is email receiving the request
'status' is the status of the connection
'counter' is request increment
這是我的HTML部分:
<input name="connect" type="button" value="Connect with <?php echo"$mem_com[name]";?>" class="intag2" onclick="connt()"/>
的PHP部分工作正常。我唯一的問題是通過jQuery將請求發送到PHP並返回到現在顯示基於成員活動的連接狀態的jQuery。
您將需要使用ajax post/get方法將變量/ s發送到外部文件。這[鏈接](http://api.jquery.com/jQuery.post)將幫助你 – punit