----- Original Message -----
From: "Bob"
Hi Rob,
I'm using PHP 4.4.4 (shared server so no choice, other than moving) so can't
use file_put_contents().
You don't need to write me a complete program, just the concept and main
points.
I've got to do some of the work myself <grin>.
I've never bothered recorded $_SERVER['REMOTE_PORT'] before. What do you use
it for?
Thanks, Bob E.
p.s. Sorry I'm slow at replying at the moment as I'm rewiring my son's shop.
He's got me doing it as I work cheap. A cup of tea every hour.
------------------------------------
Hi Bob,
Below is the additional code for php version 4.x.x compatibility.
The $_SERVER[REMOTE_PORT] was just a curiosity thing.
Thanks, Rob.
file_put_contnets for php < 5.x.x
<?php
if ( !function_exists('file_put_contents') && !defined('FILE_APPEND') )
{
define('FILE_APPEND', 1);
function file_put_contents($n, $d, $flag = false)
{
$mode = ($flag == FILE_APPEND || strtoupper($flag) == 'FILE_APPEND') ?
'a' : 'w';
$f = @fopen($n, $mode);
if ($f === false)
{
return 0;
}
else
{
if (is_array($d))
{
$d = implode($d);
}
$bytes_written = fwrite($f, $d);
fclose($f);
return $bytes_written;
}
}
}
?>
------------------------------------
Please remember to write your response BELOW the previous text.
Community email addresses:
Post message: [email protected]
Subscribe: [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
List owner: [EMAIL PROTECTED]
Shortcut URL to this page:
http://groups.yahoo.com/group/php-listYahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/php-list/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/php-list/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/