Browser Window Closes
Posted: Mon May 20, 2002 2:38 am
Hi,
I have made a download counter for my website, on some browers when the file is selected to download, it pops up the file download box and the window itself disappears. Any suggestions, is it a ie setting? or php code?
The Code:
<?
#!/usr/bin/perl
$extension = ".rtx";
$counterdir = "counters/";
$textfont = "Verdana"; //text font for the error msg
if (file_exists("$get$extension"))
{
header("location: $get$extension");
$file = fopen("$counterdir/$get$extension.txt","r+");
$count = fread($file, filesize("$counterdir/$get$extension.txt"));
fclose($file);
$count += 1;
$file = fopen("$counterdir/$get$extension.txt","w+");
fputs($file, $count);
fclose($file);
}
else echo "<font face=$textfont size=2>";
echo "<center><br><br>That file [<b>$get$extension</b>] is not available for download.<br>";
echo "Please contact the server administrator: <a href='mailto:webmaster@milenia.34sp.com'>Webmaster</a>.";
?>
I have made a download counter for my website, on some browers when the file is selected to download, it pops up the file download box and the window itself disappears. Any suggestions, is it a ie setting? or php code?
The Code:
<?
#!/usr/bin/perl
$extension = ".rtx";
$counterdir = "counters/";
$textfont = "Verdana"; //text font for the error msg
if (file_exists("$get$extension"))
{
header("location: $get$extension");
$file = fopen("$counterdir/$get$extension.txt","r+");
$count = fread($file, filesize("$counterdir/$get$extension.txt"));
fclose($file);
$count += 1;
$file = fopen("$counterdir/$get$extension.txt","w+");
fputs($file, $count);
fclose($file);
}
else echo "<font face=$textfont size=2>";
echo "<center><br><br>That file [<b>$get$extension</b>] is not available for download.<br>";
echo "Please contact the server administrator: <a href='mailto:webmaster@milenia.34sp.com'>Webmaster</a>.";
?>