PHP Classes

File: email.php

Recommend this page to a friend!
  Classes of Johan Barbier   No Timeout   email.php   Download  
File: email.php
Role: Example script
Content type: text/plain
Description: example
Class: No Timeout
Split the execution of long tasks in small steps
Author: By
Last change: Added multiple asynchronous threads handling via stacks
Date: 18 years ago
Size: 1,421 bytes
 

Contents

Class file image Download
<?php
/**
* basic test reading a file
* here, we use lines to retrieve the file contents
* step is 10 lines
*/
set_time_limit (5);
$sFile = 'email.txt';
$iSize = filesize ($sFile);
?>
<?xml version
="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <script language="Javascript" type="text/javascript" src="class/class.noTimeOut.js"></script>
        <script type="text/javascript">
        var sString = 'Email envoyé : '+' | ';
        oBuffer = new noTimeOut ();
        oBuffer.declareStack ('EMAIL');
        oBuffer.initialize ('EMAIL', 'START', 0);
        oBuffer.initialize ('EMAIL', 'LIMIT', <?php echo $iSize; ?>);
        oBuffer.initialize ('EMAIL', 'STEP', 1);
        oBuffer.initialize ('EMAIL', 'SUBSTR', sString.length);
        oBuffer.initialize ('EMAIL', 'FILE', '../<?php echo $sFile; ?>');
        oBuffer.initialize ('EMAIL', 'TARGET', 'divContent');
        oBuffer.initialize ('EMAIL', 'MSG', 'msg');
        oBuffer.initialize ('EMAIL', 'SCRIPT', 'scripts/emailSend.php');
        oBuffer.initialize ('QUERY', 'TYPE', 'FILE_LINE');

        oBuffer.startWork ('QUERY');

        </script>
    </head>
    <body>
        <div id="msg">Waiting</div>
        <div id="divContent" style="width: 500px;"></div>
    </body>
</html>