Hi,

Friend i want to run a php script when some body access a jpg file i.e. i have a file like

www.localhost/test/abc.jpg

so some body try to access this file i want to run a PHP script file also.

i know that i can make a php file and then some body brows this i run a script and then redirect to image but it is not my problem solution.

thier is also a idea that some script watch this file (abc.jpg) and when some body access this file it run a script but how it watch this file?

    I haven't done it myself, but if you are running Apache then look into mod_rewrite

    It is pretty much the only way (I think?) to divert requests for images and whatnot to a PHP file.

    In that PHP file you can do all the processing you want (e.g.: check for session security to see if they are authorized to view/download the image/file or maybe just update a view/download counter) and then output the proper content-type header()'s and then readfile() the file you want to serve

    If I was more familiar with mod_rewrite, then I'd throw out the proper rule to put in your httpd.conf or .htaccess ... maybe someone else has the exact recipe needed

      i try to get help here but on my topic i do not get help. Please some body more help me ......

        are you running apache or iis?

          Now i am runnig appachi? and what about in case of iss

            Write a Reply...