Page 1 of 1

include and coding explosion

Posted: Tue Oct 04, 2005 5:04 am
by tkarven
Hi,

If we include a script from an external webpage, will that explode our origin script coding ?

Thanks in advance.

Posted: Tue Oct 04, 2005 5:42 am
by Jenk
In what way do you mean?

Literally make your machine explode? ( :P ) or have the same result as the function explode()?

Posted: Tue Oct 04, 2005 5:46 am
by tkarven
for example i got some page that get displayed from affiliate external website. of course one of the way is to use iframe but it will spoil the design of the whole webpage. So instead of it, i prefer to include externally to my existing page using coding like following ...

include("external_page.php");

shouldn't be any problems, but just to double confirm it .

Posted: Tue Oct 04, 2005 6:02 am
by Jenk
That will fail, try using something like file_get_contents() instead :)

EDIT: Depending on what you want to do of course, but it sounds like you want to include the output of the external file and not access the code itself?

Posted: Tue Oct 04, 2005 6:11 am
by tkarven
yea is getting the output , so i should use file_get_contents ?

Posted: Tue Oct 04, 2005 6:12 am
by Jenk
yes :)

Posted: Tue Oct 04, 2005 6:16 am
by tkarven
hmmmh, file_get_contents doesnt seems to work, while on the other side include() works perfectly, the only additional tasks which i have to do is to define everything in full path on the origin file to be included.

Posted: Tue Oct 04, 2005 6:18 am
by tkarven
okie i using file_get_contents already, sorry for mis-words just now, it's because i didnt echo the string return. but still, i need to define everything in origin file in full path. Anyway, thanks for your reply, very much :D

Posted: Tue Oct 04, 2005 7:28 am
by tkarven
how about some page that need to gather input and process different output or even redirect to different page based on the input? and these different page might be different for each external host.

if we declare that input as a variable and get contents of the processing page, the value is not passed to the included page.

one of the solution i found is to pass the input together with a backlink, just wondering are there a better solution :)

Posted: Tue Oct 04, 2005 8:39 am
by Jenk
I've never used it, so I could be wrong, but it sounds like you want cURL