Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Including external SSL content

Status
Not open for further replies.

pr0fess0r

Programmer
Jul 10, 2001
25
NZ
Hi

I come from a PHP background and would like to know the code to include content from an external URL. In PHP, it's

<?
include(&quot;?>

and to include content from a secure URL, it's

<?
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, &quot;curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_exec ($ch);
curl_close ($ch);
?>

Whats the ASP equivalent?

cheers
 
Hey pr0fess0r,

welcome to ASP.
here is the standard include
<!--#include file=&quot;topnav.ssi&quot;-->

As I understand it isn't ASP but a server side include. Microsoft servers will process these on files with .shtml but they work in ASP as well. They probably work on some other servers as well.

Strictly speaking you are not supposed to be able to include a file that is above your file on the file structure. Many servers do allow this though. It's worth checking out before you layout your directories.

Have fun in ASP



Travis Hawkins
BeachBum Software
travis@cfm2asp.com
 
well,

stricly speaking that should not be allowed by the
<!--#include directive
but some servers do allow itt. So give it a try.

An alternative that you could look into is
XMLhttp
it's a little more complicated but you can load pages into your ASP script and display, parse, or whatever you want.
It seems slower though.

I'm sure if you search this forum for XMLhttp you will find many examples of it's use.



Travis Hawkins
BeachBum Software
travis@cfm2asp.com
 
You will indeed need to use the MSXML component to make an HTTP connection and grab the content. A bit more complex but not too bad. As thawkins noted there are a lot of threads here on it -- a search for MSXML in this forum will turn up many threads on it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top