php POST response

Posted by amit on Stack Overflow See other posts from Stack Overflow or by amit
Published on 2010-03-13T21:18:41Z Indexed on 2010/03/13 21:25 UTC
Read the original article Hit count: 346

Filed under:
|
|

I am making a POST to another php file that I want to render in the browser. so clearly, using jquery POST wont work, since it works through AJAX.

echo    '<div class="showcase_URL"><a class="purl" name="'.$row->num.'" href="#">PROJECT URL</a></div>';

what I have till now in javascript is:

$(".showcase_URL a").click(function() {
  //alert($(this).attr("name"));
    var number = $(this).attr("name");      
    $.post(
    "app-display.php", 
    {app: number}, 
    function(data){
        top.location.href = 'app-display.php';  
        });
});

what I have in app-display.php:

$query = 'SELECT num, title, thumb_url, url, type, cat, dated, details FROM app WHERE `num` = "$_POST[app]"';

but it is currently giving me a page without the contents of app-display.php. all the other fragments of the page are loading: header, footer etc. the PHP Response (in Firebug) I am getting is the normal html of the page.

how should i do it?

© Stack Overflow or respective owner

Related posts about php

Related posts about JavaScript