CodeIgniter Forums
Help ME. Read file from REMOTE Server - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Help ME. Read file from REMOTE Server (/thread-23292.html)



Help ME. Read file from REMOTE Server - El Forum - 10-06-2009

[eluser]Exxon[/eluser]
HI first post but have been using Code Igniter for a year now and before I start the question let me just say YOU GUYS ROCK. I can't even imagine a website without Code igniter at the CORE.

OK but the question. I am developing a Hosted CMS that will allow users to create websites and manage them for free and just pay when they want a bigger package (Need to pay my own server costs Big Grin). But now the question the idea from the start was to allow the users to view their website by going to http://mywebsite/website/yourwebsitename and http://yourwebsite.mywebsite.co.za (Proudly South-African). I then build a remote extension which would be accessed by http://mywebsite/website/yourwebsite/remote/URL-ID/. This path will render all menu items according to the URL you registered and then request in the url.

Now comes the problem I build a analytics library which stores a user's info (like browser, OS, country etc.) and their page views). I intended from the start to just build a .php file that would simply read the website from our website so you can use the website on any URL. Now this works fine but when I read remotely the analytics can't be done as I am probably not passing the right header could you please help me I don't know anything about the headers that browsers send to give information.

Thanks, this has been bothering me for quite some time


Help ME. Read file from REMOTE Server - El Forum - 10-06-2009

[eluser]Exxon[/eluser]
bump... Anyone Plz?


Help ME. Read file from REMOTE Server - El Forum - 10-06-2009

[eluser]pistolPete[/eluser]
I don't really understand why you need to access the file remotely, but you could try cURL:
http://php.net/manual/en/function.curl-setopt.php

In order to simulate a browser request, you need to send at least the user agent.


Help ME. Read file from REMOTE Server - El Forum - 10-06-2009

[eluser]Exxon[/eluser]
then help me with a idea. what can I use if I want a client to be able to access their website on my server from their local or already hosted domain?


Help ME. Read file from REMOTE Server - El Forum - 10-06-2009

[eluser]sophistry[/eluser]
the PHP function file_get_contents() has usually worked for me.


Help ME. Read file from REMOTE Server - El Forum - 10-06-2009

[eluser]Exxon[/eluser]
Yes it does work but how do i read and display the website while still keeping the sessions and be able to post ?


Help ME. Read file from REMOTE Server - El Forum - 10-06-2009

[eluser]sophistry[/eluser]
oh, i see, you have "requirements" ;-)

maybe try an iframe?


Help ME. Read file from REMOTE Server - El Forum - 10-06-2009

[eluser]renownedmedia[/eluser]
You may need to install something like a proxy (check out phproxy).