-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemoscript.php
More file actions
30 lines (25 loc) · 849 Bytes
/
demoscript.php
File metadata and controls
30 lines (25 loc) · 849 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
/**
* Dummy script for testing lateLoad.
*
* TO USE:
* <script src='/path/to/demoscript.php?
* sleep= how many seconds to wait before returning this script. Default=4
* into= id of the div to put the text into.
* text= the text to put into the div.
*
* @author jls
*
* @version 1.0 2012-05-04
*/
header ('Content-type: text/javascript');
$nSecs = $_GET['sleep'] ? (int) $_GET['sleep'] : 4;
$htmInto = $_GET['into'] ? htmlentities($_GET['into'], ENT_QUOTES) : '(unknown)';
$htmText = $_GET['text'] ? htmlentities($_GET['text'], ENT_QUOTES) : "This script took {$nSecs} seconds to load.";
sleep($nSecs);
print "
domContainer = document.getElementById('{$htmInto}');
domContainer.innerHTML = '{$htmText}';
g.logEvent ('***Loaded the {$htmInto} script');
";
?>