Hi guys,
I've just read this short tutorial about Ajax : I understand how easy it is to replace the content of a div by something else.
But how am I suppposed to do if, by the same Ajax technique, I just want to refresh a div whose content is supposed to change in accordance to the $_POST variable like in the example below?
As you can see, I'm trying to keep the HTML/PHP code structure as linear as possible to make it less confusing.
Thanks a lot to anyone who will help
I've just read this short tutorial about Ajax : I understand how easy it is to replace the content of a div by something else.
But how am I suppposed to do if, by the same Ajax technique, I just want to refresh a div whose content is supposed to change in accordance to the $_POST variable like in the example below?
As you can see, I'm trying to keep the HTML/PHP code structure as linear as possible to make it less confusing.
Code:
<?php
echo"
... some HTML ...
<div id=\"update_zone\">
";
if ($_POST["action"] == 1) {
echo"
page 1
";
} else if ($_POST["action"] == 2) {
echo"
page 2
";
} else {
}
echo"
</div>
... some HTML ...
";
?>
Thanks a lot to anyone who will help