Code Snipplet Help
Posted: Tue Dec 23, 2003 2:10 am
K Guys I've got sort of a nubby question but I have this code that counts download counts but I want to change it from this:
Clicked Link > New Page -Displays Counter & Click to download the file
I have it modified to Display the counter on the first page but I can't seem to skip the download part. Heres what we gotto modify.
In other words I need to so when the first link is clicked the file is downloaded and the counter goes up too.
TY IN ADVANCE!
Clicked Link > New Page -Displays Counter & Click to download the file
I have it modified to Display the counter on the first page but I can't seem to skip the download part. Heres what we gotto modify.
In other words I need to so when the first link is clicked the file is downloaded and the counter goes up too.
$include = "file.txt";
$file1 ="http://www.****.com/yourfile1.zip"; //set these to the URLs of the files to be downloaded.
$file2 ="http://www.****.com/yourfile2.zip";
$file3 ="http://www.****.com/yourfile3.zip";
$file4 ="http://www.****.com/yourfile4.zip";
$file5 ="http://www.****.com/yourfile5.zip";
$file6 ="http://www.****.com/yourfile6.zip";
////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////
$include = "file.txt";
if ($x == 1) {
$filename = "file1.txt";
$fp = fopen( $filename, "r+" ) or die ("no file opening is occuring"); //$fp is short for file pointer
flock($fp,1); //allows file reading but prevents writing
$counter = fgets( $fp, 6 ); //sets variable counter to where filepointer is
$counter++; // increments counter by 1
rewind($fp); // re-sets file pointer to start of file.
fputs( $fp, $counter); //writes the value of the counter to where filepointer is.
flock($fp,3); //releases file
global $file1, $include;
$include = "file1.txt";
print "<p align='center'><a href='$file2'>click to download</a></p>";<---- THIS WHAT WE GOTTO MODIFY
TY IN ADVANCE!