|
|
Variables for web images. Is this possible?
|
|
|
|
Mac Elite
Join Date: May 2002
Location: Los Angeles, CA.
Status:
Offline
|
|
Greetings
I was wondering if this was possible to do .....
to load up an html page with an image.
the html for the image would be something like ...
<img src="http://www.domain.com/example.gif?var=1234">
something along that line, adding a "variable" to the image so I can trace everytime that image is loaded up? [of course, with the variable changing every time that page loads up]
is something like this possible? I've personally never heard of this, but I've been told it IS possible.
????? Thanks!
|
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Feb 2001
Location: Manhattan
Status:
Offline
|
|
you can write a quick perl/php/asp script that accepts a variable which then tells the script to serve that image and log the viewing. you would then access it with:
Code:
<img src="/cgi-bin/imagescript.pl?image=003" />
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Aug 2000
Location: Minneapolis, MN
Status:
Offline
|
|
Are you looking for an 'image counter' to count how many times it has been viewed? There are a few image gallery scripts written in PHP that will do this for you, but it give you more than that and may be tricky for you to set up.
See if your ISP allows PHP scripting, go to:
http://www.freshmeat.net/
Then do a search for 'gallery' and you should find what you are looking for.
Good luck!
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: May 2002
Location: Los Angeles, CA.
Status:
Offline
|
|
Originally posted by ameat:
you can write a quick perl/php/asp script that accepts a variable which then tells the script to serve that image and log the viewing. you would then access it with:
Code:
<img src="/cgi-bin/imagescript.pl?image=003" />
Is the ASP script code easy to write? Example maybe?
Thanks for the help!
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status:
Offline
|
|
Originally posted by badtz:
Is the ASP script code easy to write? Example maybe?
Thanks for the help!
I couldn't help with asp, but to do it as php or a CGI is trivial. Let me know which one you want to do and I'll post an example (or someone else will).
|
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Oct 1999
Location: San Jose, Ca
Status:
Offline
|
|
If what you are trying to do is to track the number of times something has been loaded, why not simply count the number of times that image appears in your server hit log? If you are using apache and have command line access this is trivial. If this is what you want just enter this on the command line:
Code:
cat /path/to/server-log | grep "image-name"
On my system /path/to/server-log is /var/log/httpd/access_log. If you only want a count of the number of times (and don't want the rest of the information), then put a -c in front of the image-name.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|