If I want to click a button on the rendered HTML page to go to a new page (passing the session), I use a Javascript function:
Code: Select all
<SCRIPT TYPE="text/javascript">
function page(url)
{
document.location.href=url.concat("?", "<?php echo SID; ?>");
}
</SCRIPT>
Code: Select all
<INPUT TYPE=\"BUTTON\" VALUE=\"Cancel\" onclick=\"page('nvb_main.php')\">
However, if I am analysing a POST from the page in my php code, and decide I need to switch to a different page (and maybe come back after the other page has done its work), how do I do it (in php)? It has to be obvious, but I just can't see it.
For example, on a form, the user has clicked a radio button saying he wants a different address to the one given by default, and when he submits the form, I need to show him the "Find Address" form (in a different php file). I can return the information in $_SESSION variables - but how to get that form up?
PS: if there is something obvious I should have searched for and didn't think of, I'm sorry!