• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

PHP to CF Conversion

Contributor ,
Dec 11, 2008 Dec 11, 2008

Copy link to clipboard

Copied

I asked in a JS forum how to delay a browser closing for a couple seconds and someone came back with the solution, however they supplied one of the pieces in PHP to which I know nothing about.

I know CF has no sleep function, but would like to see how much of this can be converted into a cfm page. I can try to think of a way to delay the end.

Here is their snippet:

<?php
$secs = (isset($_GET["t"]) && is_numeric($_GET["t"])) ? $_GET["t"] : 5;
sleep($secs);
echo("ready");
?>

Would something like:
<cfscript>
seconds = url.seconds;
**Something like a loop that runs for 5 seconds**
return done;
</script>
TOPICS
Advanced techniques

Views

368

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Dec 11, 2008 Dec 11, 2008

Copy link to clipboard

Copied

Hi,

Here is the JS code,

<script language="javascript">
setTimeout('self.close();',5000);
</script>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Dec 11, 2008 Dec 11, 2008

Copy link to clipboard

Copied

Thanks but it has to be a programming language. JS is calling out to it to create a delay in the page closing so Flex has time to send out a webservice request.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 12, 2008 Dec 12, 2008

Copy link to clipboard

Copied

projectproofing wrote:
> I asked in a JS forum how to delay a browser closing for a couple seconds and
> someone came back with the solution, however they supplied one of the pieces in
> PHP to which I know nothing about.
>
> I know CF has no sleep function, but would like to see how much of this can be
> converted into a cfm page. I can try to think of a way to delay the end.

http://www.petefreitag.com/item/85.cfm

--
Mack

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 12, 2008 Dec 12, 2008

Copy link to clipboard

Copied

LATEST
at least a couple of ways to do this:

1. sleep the java thread:
http://tech.groups.yahoo.com/group/coldfusion-howto/message/38270

2. use the CF_SLEEP custom tag (google it)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation