Dear PHP builders
I am desperate. I have a script that uploads a user file, copies it to the right directory, opens it and starts uploading the data.
The script works very well!
EXCEPT when the uploaded user file is larger than 80kB, and consequently, the data resulting in the PHP script are large as well.
The bit of script where the problem occurs is:
$hrmfile=file($folder.$fname);
?>HRM-file: <?echo $fname;?><BR><?
?>Interval: <?echo interval($hrmfile);?> seconds<BR><?
?>Units: <?echo units($hrmfile);?> <BR><?
?>Cadence on: <?
if(cadence($hrmfile)==1)
{echo "yes";}
else
{echo "no";}?><BR><?
$interval=interval($hrmfile);
$data=data($hrmfile);
echo "intermediate -1 ";
$arrdata=hsa($data,cadence($hrmfile),units($hrmfile));
echo "intermediate 0 ";
$hf=$arrdata['hf'];
$speed=$arrdata['speed'];
$alt=$arrdata['alt'];
unset($arrdata);
echo "intermediate 0a ";
$ttime=ttime($speed,$interval);
echo "intermediate 0b ";
$cyctime=cyctime($speed,$interval);
[after this follows the rest of the script which is for the moment irrelevant]
Now, for a smaller user file, the whole script is passed, all "intermediates" are echoed and the output is fine. But for a large user file >80kB, the script returns the following:
HRM-file: 02050901a2.hrm
Interval: 5 seconds
Units: SI
Cadence on: no
intermediate -1 intermediate 0 intermediate 0a
And then it stops dead. Nothing. No error message.
Since "intermediate 0a" is echoed and "intermediate 0b" is not, the problem should be in the user-function ttime, shouldn't it?
This function looks like this:
function ttime($speed,$interval)
{$speedsize=sizeof($speed);
$ttime[]=0;
$last=array_slice($ttime,-1);
$last=$last[0];
for($i=1;$i<$speedsize;$i++)
{$ttime[]=$last+$interval;
$last=array_slice($ttime,-1);
$last=$last[0];
}
return $ttime;
}
which, again, works fine when a small file was uploaded.
My question is: what might cause the problem that terminates my script without an error message? (apologies for the long post)
Regards,
Boudewijn Verhaar