Jump to content

passing parameter using include_once()


african_bob

Recommended Posts

Hi,

 

Im new to using php and im having difficulty passing a paramter via the include_once method. I have a page which implements paging so each time a user clicks on the next button it calls the same page but with a new page number .e.g <a href=\"javascript:goToPage('paging.php?page=$page','lists');\">[Next]</a>

 

This works fine when i just use the href without the include_once function.

 

Any suggestions on how i can fix this?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/105167-passing-parameter-using-include_once/
Share on other sites

this is the goToPafe function i use;

function goToPage(page, headerText)

{

 

var masterPage = "index.php";

//var destinationPage = masterPage +"?page="+page;

var str = "Masterpage:"+masterPage+" Page:"+page;

document.forms['navigationForm'].action = masterPage;

document.forms['navigationForm'].page.value = page;

document.forms['navigationForm'].headerText.value = headerText;

document.forms['navigationForm'].method = "POST";

document.forms['navigationForm'].submit();

 

}

 

 

the problem im having is that when i try pass the parameter using the gotoPage function the function sees the string and paramater and thinks its the name of a file and looks for that file however i want it to recognise that im passing a parameter

 

This is the warning i get;

 

Warning: include_once(paging3.php?page=2) [function.include-once]: failed to open stream: No such file or directory

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.