Moving to a new page
Posted: Wed Jan 30, 2008 2:18 pm
I am a fairly new user, but the answer to my question has to be so simple that I am almost embarrassed to be asking it. However I really don't know how to do this.
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:
and call it from the button's onclick method, thus:
(this is a snippet from inside a php echo).
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!
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!