Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: CURL get PHP
12-13-2010, 04:54 PM #1
- Join Date
- Mar 2010
- United Kindom
- Thanked 136 Times in 136 Posts
CURL get PHP
Hi I am just wondering can you do something like this with PHP CURL, I read everything about CURL on php.net but still unsure as I haven't really used CURL before.
Basicly I want one server to get files from a different server and use them like this.
sever 1 root
- file.php - contains '$username = "test";'
server 2 root
- file.php - contains 'print $username;'
This will be something similar to what Facebook do for their Application developers, where they read a file that they have given the developer with their codes in and it allows them to search their databases to see if the information is correct etc, can I do this with CURL or not?
12-13-2010, 07:42 PM #2
- Join Date
- Oct 2008
- Some say it's everything.
- Thanked 397 Times in 390 Posts
cURL is used to retreive the returned result from visiting a page. It will return a string if you capture the data (rather than just cURL'ing wide open, which will print the string to the page directly). You can read the cURL result to parse it for the data you want, but you can't use it as a method to directly include PHP as your example indicates.
So, yes - if you parse the cURL's string data before you try to use it. Otherwise, no.
See this page for the explanation that cURL returns a string:
Last edited by Rowsdower!; 12-13-2010 at 07:51 PM.
The object of opening the mind, as of opening the mouth, is to shut it again on something solid. –G.K. Chesterton
See Mediocrity in its Infancy
It's usually a good idea to start out with this at the VERY TOP of your CSS:
Seek and you shall find... basically: validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting