Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

include_php: include a remote php file?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
starsin
Smarty n00b


Joined: 08 Feb 2004
Posts: 1

PostPosted: Sun Feb 08, 2004 4:41 pm    Post subject: include_php: include a remote php file? Reply with quote

hi

i am using smarty and i want to include some php file from other server. can i use include_php function to do that? if not how shoud i solve my problem? on maybe i can not do it in smarts?

is it possible to include remote html file?

thx 4 ur help
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Sun Feb 08, 2004 11:47 pm    Post subject: Re: include_php: include a remote php file? Reply with quote

starsin wrote:
i am using smarty and i want to include some php file from other server. can i use include_php function to do that? if not how shoud i solve my problem? on maybe i can not do it in smarts?

AFAIK include_php cannot include files via http directly. include_php uses the same resource-mechanism that is used for retrieving templates. you could write a resource-plugin that fetches resources via http, then you can use such resources in the file-attribute of {include} or {include_php}.

an easier way would be using php:
{php} include("http://...'); /* use url_fopen_wrapper */ {/php}

or write a custom-plugin that contains the include-call:
function smarty_function_my_include($params, &$smarty) { include($params['file']); }


Quote:
is it possible to include remote html file?
.
yes, you can use the {fetch}-plugin for that: http://smarty.php.net/manual/en/language.function.fetch.php
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP