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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Embeding Coldfusion code on a noncolfusion server

Status
Not open for further replies.

peter11

Instructor
Mar 16, 2001
334
US
I have a client that has a static web site (HTML).
He is currently using a service of mine where he can make a temp home page. When he activates it I would like to activate a <META http-equiv="refresh" content="0; URL="> Tag that points to my site.


The query is below is what i use with clients that have coldfusion servers.

<cfquery name="homepage" datasource="zed">
select active
from pop
</cfquery>

<cfif active eq 1><META http-equiv="refresh" content="0; URL=http://www.mysite.com/client1"></cfif>
 
is there a question in here somewhere?

We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
 
I want to run querys from a clients home page to my server. My client does not have coldfusion server.
I thought of using includes SHTML(<!--#include virtual=" -->) or php includes(<? include (" ?>) or ASP includes depending on their server.

"thefile.cfm" would include the simple query and meta tag below:

<cfquery name="homepage" datasource="zed">
select active
from pop
</cfquery>

<cfif active eq 1><META http-equiv="refresh" content="0; URL=http://www.mysite.com/client1"></cfif>

It is very important that this NEVER fails.
The questions are:
Whether or not this is a good idea?
Is there a better coding practice I should follow?
 
You cannot include a remote file the way you mention, you can only run includes on a local file. I would suggest using frames from what you want to do.

Hope this helps

Wullie

Fresh Look - Quality Coldfusion 7/Windows Hosting

The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
you can use a server http request to run a page on your server, same as <cfhttp>.

You just have to create a page that would generate output that can be used by php or whatever server technology they are running. Like a mini web service.

We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
 
I did not want to use frames because I did not want to alter the web page and there is no visible content. I just want to place a query in the head of the document.

Are you sure you can only include local files? It has been a whire but I thought SHTML allowed you to include non local files if you used "virtual".

from the brief research I did I thought PHP also allowed it. I am not sure about ASP.

Hmmm? I guess I could use frames and put my logo on as a footer and run the query there.
 
http request is an XML thing, right?

I have come upon this suggestion for other problems in the past but I have not figures out how to use it.

If you know of any tutorials for non XML people let me know.

Thanks
 
the xmlhttprequest will not allow requests to different domains.

However, read this article. It is what I would call a hack, but it might do what you want.

Kris Brixon
www.brixon.org
 
so... did you get this figurd out? why not write a web service like i suggested?

We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
 
you can't include from another page, but you sure can use cfhttp.

<cfhttp url="yourfoo.com" resolveurl="yes">

Then do what you will with it from your end.
 
MochaLatte said:
you can't include from another page, but you sure can use cfhttp.

<cfhttp url="yourfoo.com" resolveurl="yes">

Then do what you will with it from your end.

He can't use that code on a server that doesn't have CF installed.

Hope this helps

Wullie

Fresh Look - Quality Coldfusion 7/Windows Hosting

The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
no, he'd have to use PHP or asp (not a native ability to asp 3.0. FYI) or asp.net or pearl or whatever.

But that's what a web service is.
make an http request to a page that produces a certian output. then output the http variable

We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
 
for example
Code:
***CustStatus.cfm***
<cfquery name = "qGetStatus" datasource = "#ds#">
SELECT custName, custStatus
FROM customers
WERE ID = #url.id#
</cfquery>
<cfoutput>
Hello #qGetStatus.custName# your current customer status is: #qGetStatus.custStatus#
</cfoutput>
*************************
now lets say you have a page far far away on a different server in another part of the world (i'm going to write a CF example but you could do it in any language, i might look it up in php but no promises)
Code:
<html>
<body>
<cfhttp url = "[URL unfurl="true"]http://www.yourUrl.com/CustStatus.cfm?id=yourIdNumber">[/URL]
<cfoutput>
#cfhttp.fileContent#
</cfoutput>
the rest of your page here.
</body>
</html>

We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
 
php example (i think)
<html>
<body>
<?php
$message = fopen(" "r");
print $message;
?>
the rest of your page here.
</body>
</html>


We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
 
oops messed up the url

Code:
php example (i think)
<html>
<body>
<?php
$message = fopen("[URL unfurl="true"]http://www.yourUrl.com/CustStatus.cfm?id=yourIDNumber",[/URL] "r");
print $message;
?>
the rest of your page here.
</body>
</html>

We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
 
Ah I misunderstood his question, I thought he was trying to include a cf page from another cf server.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top