开发者

php include problem with urls with options ?view=task&others file not found

I really have read the other articles that cover this subject. But I seem to be in a slightly different position. I'm not using modrewrite (other articles).

I would like to 'include' a webpage its a 'Joomla php' generated page inside a php script. I'd hoped to make additions on the 'fly' without altering the original script. So I was going to 'precomplete' elements of the page by parasing the page once it was included I hadent wanted to hack the original script. To the point I can't include the file and its not because the path is wrong -

so include ("/home/public_html/index.php"); this would work include ("/home/public_html/index.php?option=com_k2&view=item&task=add"); this would not!

I've tried a variety of alternates, in phrasing, I can't 开发者_Python百科use the direct route "http:etc..." since its a current php version so must be a reference to the same server. I tried relative, these work without the ?option=com_k2&view=item&task=add

It may be the simple answer that 'options' or variables can be passed. Or that the include can't be used to 'wait' for a page to be generated - i.e. it will only return the html.

I'm not the biggest of coders but I've done alot more than this and I thought this was so basic.


this would work include ("/home/public_html/index.php?option=com_k2&view=item&task=add"); this would not!

And it never will: You are mixing a filesystem path with GET parameters, which can be passed only through the web server (utilizing a http:// call... But that, in turn, won't run the PHP code the way you want.)

You could set the variables beforehand:

 $option = "com_k2";
 $view =   "item";
 $task =   "add";

include the file the normal way:

 include ("/home/public_html/index.php"); 

this is assuming that you have access to the file, and can change the script to expect variables instead of GET parameters.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜