Adhal wrote:
Captain Paralytic wrote:
>Sorry, in future I will only answer your questions with answers that
you already know, will that help?
I am new to web creation so I was expecting a bit more detail or link.
Anyhow, thanks for your reply.
Welcome to the world of web programming! :-) Yes, we do get a little
terse here sometimes. We don't know how experienced you are, and it
saves what could be a lot of unnecessary typing (and our time).
Two things. First of all, if at all possible, place the file outside of
your DOCUMENT_ROOT (the root directory of your web server). Many
hosting companies allow you to have files and/or directories above the
root directory, i.e.
mysite
html otherdir
In a case like this, you would upload your web files to mysite/html, and
this would be the root directory of your website. You could place other
files in mysite, or create another directory mysite/otherdir to store
the files (my preference).
Now, any files in mysite/otherdir will be inaccessible directly from the
internet. But you can use readfile() to access the file, i.e. if the
file were "myfile.htm l",
readfile($_SERV ER['DOCUMENT_ROOT'] . '/../otherdir/myfile.html');
($SERVER['DOCUMENT_ROOT'] always points at the root directory of your
webserver, then you go up one directory and down to otherdir).
This would go in the page with your counter; besides incrementing the
counter, it will send the file to the user. The only other thing you
need to do is set the correct content - see the header() function for
info on this.
However, there is an easier way than all this. You should have access
to the web server's logs for your site (good hosting companies will
provide this). You can see directly from the logs exactly how many
times the file has been downloaded.
However, remember one thing - these counters are not accurate. A file
or page may be cached by any server between you and the user, and the
file/page served from the cache. This cuts down on internet traffic,
but means you won't see the request.
--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===