Page 1 of 1

[solved] include a php page with a query string using an UDT

Posted: Sat Feb 02, 2008 2:15 pm
by hostep
Hi guys

I have problem with an UDT.
I want to make an UDT which has 1 attribute and use that attribute to include an extern php page and append that attribute to the query string of that php page.

Example:
{tag attribute="value"}
And this should do something like this:
include("somephppage.php?query=" . $params["attribute"]);

Well, this doesn't seem to work unfortunately :(.

What does work, is when i do this:
include("somephppage.php");

So, from the moment I append a ? sign, it stops working. Then I get this error:
Warning: include(/***/somephppage.php?) [function.include]: failed to open stream: No such file or directory in /***/lib/content.functions.php(672) : eval()'d code on line 1


Does someone has a solution for this problem?

Thanks!

Re: include a php page with a query string using an UDT

Posted: Sat Feb 02, 2008 3:44 pm
by alby
hostep wrote: include("somephppage.php?query=" . $params["attribute"]);

Well, this doesn't seem to work unfortunately :(.
Won't work, include looks for a file named 'somephppage.php?query=XXXX', your sintax is a URL!

Works if you have 'allow_url_fopen' and 'allow_url_include' enabled in your php.ini:
include ('http://www.site.com/somephppage.php?query='. $params["attribute"]);

Alby

Re: include a php page with a query string using an UDT

Posted: Sat Feb 02, 2008 3:54 pm
by hostep
Yes indeed, I just found the same solution 2 minutes ago :P

I forgot the http://, now it works very good.

Thanks for the effort!