Alright everyone, is there any way of easily creating several HTML files without having to keep renaming and saving? I have a number of .jpg pictures and would like a HTML page for each individual picture with that same name. That might be pushing it but never hurts to ask. Up to this point I've just been renaming similar pages and changing the image, but that gets tiring so I am looking for something a bit faster. Any help is appreciated!
you could write a quick php or asp script that would do it automatically for you What is in the HTMl page just the image Once you have a list of all the images (say a directory) you could just iterate through them and create them on the fly
Unfortunately i don't know any php . I guess i'll have to learn really quick. I'm using Dreamweaver and i have a template and the pictures would go in the center in an editable region. Time to go learn some new stuff! Thank you for your help
there are possibly programs out there that will do this but I had to do something fairly similar a few weeks ago and used ASP as it was the only language on the server. It took 10 minutes to write the script and saved me about 2 days work
So i've been poking around in the world of php. But maybe some one can help me cause i couldn't seem to find an answer. I have this template in dreamweaver, is it possible to make that work with php. or do i have to redo it all with php script? And then about the number of pages i already have complete using this HTML template. Grrr, it seems im just getting more confused as i type this question. How would i go about taking that content and making it usable with php?
It's not difficult. If you want, I can help you with both PHP (web based), and a desktop based application for this task. Send me a PM if you are interested. Bye
basically you need to access the file system. So you need to look at the directory with all the images, then use a foreach loop to look at each image and create a file (using your template) with the image name.html Pretyy eash script I just dont jbae much time at the moment or I would write it for you,
From what i have seen from poking around it does seem easy, but i just don't understand the script at the moment, so a little more research wouldn't hurt. Plus JEET is going to help me out abit!
Before you start making a file for every image take a look at .htaccess It is not hard to make just 1 page that servers every image you want. First you need the index. You can place it in any php file you want and this is just a sample <? //define the path as relative $path = "/home/httpd/vhosts/spoono.com/httpdocs"; //using the opendir function $dir_handle = @opendir($path) or die("Unable to open $path"); echo "All images of $path<br/>"; //running the while loop while ($file = readdir($dir_handle)) { if($file!="." && $file!="..") //replace the jpg gif and jpeg part $file2 = eregi_replace(".jpg", "", $file); $file2 = eregi_replace(".jpeg", "", $file); $file2 = eregi_replace(".gif", "", $file); echo "<a href='./pages/$file2.php'>$file</a><br/>"; } //closing the directory closedir($dir_handle); ?> PHP: next the .htaccess part RewriteEngine on RewriteRule ^pages/(.*).php product.php?keyword=$1 Code (markup): The page product.php will serve as a dynamic page. When ever an image page is called it will go to the directory pages. If you have an image called mynewimage.jpg it will link to the page www.yourwebsite.com/pages/mynewimage.php the htaccess will take care of the page as mynewimage.php does not excist but it will be calling product.php?keyword=mynewimage