Creating a static page from img src file
I edited Nicolas d'Haussy's php gallery script(http://bolgallery.free.f开发者_运维问答r/) to render what I need. My issue is that when I click the photo, It loads the jpg file.
I would like the script to create static pages from each uploaded photo - ie. 1.jpg => 1.php
I currently have to do this manual, and thought there might be a way to have this dynamic - site I am referring to, http://photos.alexandergutierrez.info/
Here is the file I currently have, http://db.tt/dEfe2wJ
Hope this all made sense since I am not developer.
Well, you would need to edit the a element on line 112 to be to the correct place. Then I would say the rest can be completed with a simple .htaccess file and a php script. For the htaccess file to work you must be using apache. Below is the code for it:
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule (.*).php$ view.php?img=$1 [L]
Then all you have to do is make a php file called view.php that looks at the GET value for img and load that image however you want. This would allow you to do something like testimage.php which would load testimage, which would then load testimage.png
or whatever.
精彩评论