Load a page dynamically
Posted: Sun Sep 09, 2007 10:28 am
I want to load a page dynamically after click the next button. How can I do that? Any help 
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
header("location: ".$_GET['page_name']);Code: Select all
function load_page(page_name)
{
document.location.href=page_name;
}Code: Select all
<input type="button" id="btn_load" onclick="load_page('page_name');">Thanks luna80 for your help. But.....luna80 wrote:I think there are more than a solution...
One possiblity is that when you click the button you always call the same page with a parameter that tell which page you want to call and in this page you put a redirect line.
Supposing you pass the parameter "page_name" with the GET method, in the called page you will have something like this:
Another possibility is to manage the click button with a javascript function that load the page depending a parameter. In this case, an example can be:Code: Select all
header("location: ".$_GET['page_name']);
and in the form the button that call this funtion is something like this code:Code: Select all
function load_page(page_name) { document.location.href=page_name; }I hope you understand me...I don't speak english very well...Code: Select all
<input type="button" id="btn_load" onclick="load_page('page_name');">
no...asif_phpdn wrote:
Thanks luna80 for your help. But.....
Do you mean include a file or page in your first point???
Code: Select all
<form id="form1" method="post" action="page.php">
<input type="text" id="page_to_load">
<input type="submit" id="btn" value="load page">
</form>Code: Select all
header("location: ".$_POST["page_to_load"]);