There are a couple options you could explore. You could either add tags to your php so that when the server side code detects a post back event that it will only return the code within the body tag and on the client side just use document.body.innerHTML = myRequest.responseText in javascript or you could make a second page which is the "post" taget that returns the code to insert between the body tags.
Either way this is not a typical form postback that you need to do. An example for what your looking for is as follows
Javascript
:
Code:
<script type="text/javascript">
var myRequest = null;
function doPostBack(){
myRequest = new XMLHTTPRequest(); // There are several implementations of this object, you can lookup the detection script pretty much anywhere on here
var myData = "myField1=" + $get("myField1").value + "&myField2=" + $get("myField2").value; // perform some url encoding on this puppy to fix the values to make sure they're safe
myRequest.onreadystatechange = Repopulate;
myRequest.open("POST", URLtoPostTo, true);
myRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
myRequest.setRequestHeader("Content-length", myData.length);
myRequest.setRequestHeader("Connection", "close");
myRequest.send(myData);
}
function Repopulate(){
if((myRequest.readyState == 4) && (myRequest.status == 200))
{
document.body.innerHTML = myRequest.responseText;
}
}
</script>
Granted this way isn't really the best way to do it (actually, as printed it probably won't work for what you're doing at all, but it is the framework to accomplish anything like you described)