bir php komut dosyası veri gönderme

1 Cevap php

Nedir sunucuya veri göndermek ve bir php komut dosyası çalıştırmak için en iyi yoldur. Ben kullanıcı farklı bir sayfaya yönlendiriliyorsunuz ve yanıt sunucudan geri gönderilmesi gereken zorunda istemiyorum unutulmamalıdır.

...ammended... I have the following markup.

<div id='0001' class='threadWrapper'>
<div class='littleme'>

I'm hoping to have a click event associated for the .littleme that submits as its variable the ID for its parent (in this case 0001. Something like this???

 $('.littleme').click(function{
    $.post("path/to/your/script.php", { "threadID":"//value for ID???"});
});

1 Cevap

Download jQuery Insert it into your script.

Ayrıca, sadece Google Hosted jQuery ile ekleyebilirsiniz

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

Aşağıdaki javascript yerleştirin:

$.post("path/to/your/script.php", { "key":"value", "key2":"value2"});

Şimdi PHP dosyası sadece veri almak için $_POST süper global görünüyor. Bir kullanıcı sayfasını talep gibi eğer olduğunu.