SitePoint Sponsor |
|
User Tag List
Results 1 to 8 of 8
Thread: off site list into php file
-
Jun 14, 2007, 17:35 #1
- Join Date
- Apr 2006
- Location
- at my desk
- Posts
- 136
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
off site list into php file
lets say i have a few sites on various urls, hosts, on various platforms, php setups etc.
what would be the easiest way to have a list of values in a central location on one host that i could import into an array in php from all locations..
so every site could import the data..
ive tried php includes but it doesnt work because some hosts have php setup to stop it.
i thought about using xml but i dont know how to output or import it
any suggestions?
-
Jun 14, 2007, 17:44 #2
- Join Date
- Aug 2005
- Posts
- 453
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Use a text file, something along the line of CSV... Variable, value
Computers and Fire ...
In the hands of the inexperienced or uneducated,
the results can be disastrous.
While the professional can tame, master even conquer.
-
Jun 14, 2007, 18:01 #3
- Join Date
- Aug 2000
- Location
- Philadephia, PA
- Posts
- 20,578
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
Your options are URL file-wrappers (include/require/fopen/file/file_get_contents/readfile...), sockets, the cURL libraries, or executing a shell command.
URL file-wrappers are disabled at many hosts as you've discovered, which means you can't use any file functions to retrieve files outside the local server.
http://us2.php.net/fsockopen for info on opening a socket and reading from it.
The curl library may or may not be available... depends on the host again.
And unlikely to be available at a host that bothered to turn off URL file wrappers is the ability to run shell commands.. to exec()/shell_exec() a wget or curl via CLI to download.
I don't think there's any solution guaranteed to work if you don't have control over the environment.Try Improvely, your online marketing dashboard.
→ Conversion tracking, click fraud detection, A/B testing and more
-
Jun 14, 2007, 18:20 #4
- Join Date
- Sep 2006
- Posts
- 12
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
A delimited text file and "split" is going to be the quickest/easiest way.
-JasonDopeDomains.com - 20,000 New domains a day starting at $5
sorted by Pagrank, Hits, Length, etc.
Find the perfect name cheap!
-
Jun 14, 2007, 19:18 #5
- Join Date
- Aug 2000
- Location
- Philadephia, PA
- Posts
- 20,578
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
Try Improvely, your online marketing dashboard.
→ Conversion tracking, click fraud detection, A/B testing and more
-
Jun 14, 2007, 19:25 #6
- Join Date
- Aug 2005
- Posts
- 453
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Use an include statement, two caveats
1. Make sure the file is in a directory which has read privileges set for world.
2. Make sure the file is not included in the list of files not permitted for hot linking? ( would be just like an image file which you have set for deny hot linking in your C-panel.Computers and Fire ...
In the hands of the inexperienced or uneducated,
the results can be disastrous.
While the professional can tame, master even conquer.
-
Jun 14, 2007, 19:34 #7
- Join Date
- Aug 2005
- Posts
- 453
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
One last thought, have you considered ftp_fget()?
You must have an ftp service with your domain.
Documentation @ : http://us.php.net/function.ftp-fgetComputers and Fire ...
In the hands of the inexperienced or uneducated,
the results can be disastrous.
While the professional can tame, master even conquer.
-
Jun 14, 2007, 19:34 #8
- Join Date
- Aug 2000
- Location
- Philadephia, PA
- Posts
- 20,578
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
Try Improvely, your online marketing dashboard.
→ Conversion tracking, click fraud detection, A/B testing and more
Bookmarks