I am writing a plugin using WP3.2 and I am trying to import a gallery using an ajax call. I am able to get the correct html response along with a 404 header. I tried hardcoding the header but that does not seem to work. I hope your fresh eyes will see the problem. Here's the ajax and php code:
$j('#mybutton').click( function() { dataString = $j("#my-ajax-form").serialize(); $j.post("/wp-content/plugins/myplugin/getref.php", dataString, function(data){ $j("#first-tab").html(data).hide().fadeIn(1000); } ); $j("#second-tab").empty(); for( i=1; i < 5; i++){ $j.ajax({ type: 'POST', url: "/wp-content/plugins/myplugin/getcommentary.php", data: dataString, success: function(data){ $j("#second-tab").append(data); } }); } $j("#third-tab").empty(); $j.ajax({ type: 'POST', url: "/wp-content/plugins/myplugin/getvideos.php", data: dataString, success: function(data){ $j("#third-tab").append(data); }, error: function(data){ //$j("#third-tab").append(data.responseText); alert(data.responseText); }, }); $j("#fourth-tab").empty(); for( i=1; i < 2; i++){ $j.ajax({ type: 'POST', url: "/wp-content/plugins/myplugin/gethistory.php", data: dataString, success: function(data){ $j("#fourth-tab").append(data); } }); } return false; } );
<span class="syntaxdefault"><php?require_once('/home/website/public_html/wp-content/plugins/tubepress_pro_2_2_0/sys/classes/TubePressPro.class.php');require_once('../../../wp-load.php');header('Response: HTTP/1.1 200 OK'); // Trying to override the 404 header$searchterms .= "motorcycles";print TubePressPro::getHtmlForShortcode("resultsPerPage='3' mode='tag' tagValue='" . $searchterms . "'");?></span>
Thanks for you help,
Chris