|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Reading a file from another website
How can I do something like this in Coldfusion to return the HTML sourcecode of the link:
Code:
<cffile action="read" file="http://www.google.com" variable="googleSourceCode"> In PHP you can do the following: PHP Code:
|
|
#2
|
|||
|
|||
|
Assuming your server supports this. Look into cfhttp to pull the Web page in question.
<cfhttp url="http://www.yahoo.com" resolveurl="yes"></cfhttp> then report the results using HTMLcodeFormat(). |
|
#3
|
|||
|
|||
|
I'm not sure what the if statement in your PHP code is doing, but the CFHTTP call should return you the actual source code of whatever URL you call. Can you elaborate?
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian. How to Post a Question in the Forums |
|
#4
|
||||
|
||||
|
That worked well, although it should be added that the variable the sourcecode is stored in is #cfhttp.fileContent#. And I did not use HTMLcodeFormat() becasue I was printing out the sourcecode as HTML in another page, that is as opposed to printing out the sourcecode as readable text for the user to examine.
Also, i'm making another post on how to find the server's IP address. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Reading a file from another website |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|