Welcome Guest, Not a member yet? Register   Sign In
Including a file
#1

[eluser]Philo01[/eluser]
Hi there!

I was wondering if there is a way to do this.
Lets say you have a website (wordpress for example) and an standalone application (CodeIgniter).

Now you want to include text generated by this application.
Lets say our generated text link is: http://www.yoursite.com/mygenerator/output/text

Now what you could do is just include that link, but many servers don't allow that:

Code:
<?php
    include('http://www.yoursite.com/mygenerator/output/text');
?>

This will probably return:

Quote:Warning: include() [function.include]: URL file-access is disabled in the server configuration

(Is it maybe possible to create a file called in /mygenerator/output.php hook this file up to CI and load the data? Because if you would include mygenerator/output.php, this would work because it isn't a url.)

Now a other way to include this is using an iframe, but I don't really like this because styling you have applied on your website, does not apply with data in your iFrame.

Anyone who could help me out! Smile

Would really appreciate it!

Kind regards,

Philo

Found Methods - #1
---------------------------------------------------------------------------------
I found this method to be working but not sure if its the best way.
Create a file mygenerator/output.php and add the following line:

Code:
echo file_get_contents('http://www.yoursite.com/mygenerator/output/text');

Then include output.php in the main site
---------------------------------------------------------------------------------


Messages In This Thread
Including a file - by El Forum - 10-25-2009, 03:41 PM
Including a file - by El Forum - 10-25-2009, 03:54 PM
Including a file - by El Forum - 10-25-2009, 04:00 PM



Theme © iAndrew 2016 - Forum software by © MyBB