Browser Window Closes

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply

Would you register to get downloads?

Yes
0
No votes
No
8
100%
 
Total votes: 8

milenia
Forum Newbie
Posts: 1
Joined: Mon May 20, 2002 2:38 am
Location: Coventry , UK

Browser Window Closes

Post by milenia »

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>.";

?>
User avatar
cwcollins
Forum Commoner
Posts: 79
Joined: Thu May 16, 2002 3:51 pm
Location: Milwaukee, WI, USA

Post by cwcollins »

I'm pretty sure this is an issue with the browser. i have our camus search engine setup to generate vcards in a similar manner, but different browsers behave differently [there is an obvious statement]...

-c.w.collins
Post Reply