Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Getting remote information
Old 01-14-2009, 06:49 PM Getting remote information
melefire's Avatar
Experienced Talker

Posts: 46
Name: matt
Trades: 0
I have a script that needs to get one string of information from a remote script that is stored in a PHP file. But I don't know how to include or read remote files. Can anyone help?
melefire is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-14-2009, 08:15 PM Re: Getting remote information
NullPointer's Avatar
Will Code for Food

Posts: 2,784
Name: Matt
Location: Irvine, CA
Trades: 0
Do you need to get the output of that remote php file, or the source itself? If you just need the output you can just use include and the url to the file:
PHP Code:
include "http://example.com/file.php"
If you need to access the source code or you otherwise cannot access it via url then you need to read up on php ftp functions:
http://us3.php.net/ftp
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 01-15-2009, 09:31 PM Re: Getting remote information
melefire's Avatar
Experienced Talker

Posts: 46
Name: matt
Trades: 0
i just need the output of the remote file, not the PHP contained in it
melefire is offline
Reply With Quote
View Public Profile
 
Old 01-16-2009, 12:30 AM Re: Getting remote information
anderswc's Avatar
Super Talker

Posts: 132
Name: Will Anderson
Location: Terre Haute, IN
Trades: 0
The code NullPointer referenced might not work in some web hosts. Also, if you need to assign the output to a variable rather than just printing it, include can be a problem.

You're more likely to be able to use get_file_contents(). This tutorial describes how to do that, as well as an alternative if that's not supported.

http://www.howtogeek.com/howto/progr...ring-variable/
__________________
Will Anderson

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
anderswc is offline
Reply With Quote
View Public Profile Visit anderswc's homepage!
 
Old 01-21-2009, 09:34 PM Re: Getting remote information
melefire's Avatar
Experienced Talker

Posts: 46
Name: matt
Trades: 0
thank you
melefire is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Getting remote information
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.14970 seconds with 12 queries