Quote:
Originally Posted by ratbastid
...But you want to be able to bring in images from any directory? Is that it?
|
Exactly. I take photo's of different places a lot as part of my job. The goal here is that all images come from imgs/blah where blah is the folder named for the place. In this case it would be imgs/brewery. The php file that sits in the root is called brwery.php, and calls the images using the variable. The goal as a crude content managment system is that say I took pictures of a new abandoned building. Let's call it stockhouse. Then I open up the brewry page in my editor, change the descriptive text in the photo_nav div, and save it as stockhouse.php. Then I place all the images in a newly created imgs/stockhouse folder. index.php?id=stockhouse would call the new page, and the php code would pull the apropriot images.
I don't mind having to change a variable in the php code when I create the new page to point to the correct image folder, I just don't want the huge varaibe url. So a php page for each place (Client), that corrisponds to a sub-folder in imgs/. I can change the varaible on each page I make, I just don't want to show all my data in the URL.
Becuase the image is called using id2, I'd like to just name each image name_number and the script, having the imgs directory variable coded in when I made the page, would know that id2=1 means grab say stockhouse_1.jpg and diplay it in the image display area.
Having variable two simply equal a number looks a lot cleaner. Bonus points if in doing this, there is a way to not show anything besides the first variable. I don;t mind index.php?id=blah&id2=1 for example, but being able to hide varaible two all together to create arch13.com/index/php?id-blah without showing the other variables would be awsome.
As it may be obvious, I'm pretty clueless on varaible usage (or anything else) in PHP.
Quote:
I suggest you use the oft-overlooked PATH_INFO field to pass the file location, rather than a query-string parameter.
In the url:
http://www.arch13.com/index.php/imgs...r11?id=brewery
You should end up in index.php with:
$_REQUEST[id] = "brewery"
and
$_SERVER[PATH_INFO] = "/imgs/brewery/brewerycolor11"
It's still a lengthy URL, but it's not carying a ton of extra info in the QUERY_STRING, and it looks (except for that ".php" in there) like any old URL to a file or directory.
PATH_INFO is great for hiding the fact that it's a dynamic page. I one time turned on CGI-EXEC on the root htdocs directory, put a Perl CGI in there called "pages", and called it with URLs like:
http://www.site.com/pages/product/1234.html
My "pages" script then spun out a page based on my "product" template with data from MySQL for item number "1234", and Google was none the wiser.
|
Hmmm. Not trying to hide the page being dynamic from the search bots. Just trying to clean up the url and set up something that makes creating lots of these pages easier.
I don't want to show server paths at all. I just want arch13.com/index.php?id=blah where blah is the page they are at (This is how it currently works, allowing blah to just be a text file since it only needs to be parsed as part of the include) Looking at the url now, they go "Oh, I'm at the blah page of his site" since the format is easy to deduce.
The idea is that on
this page, the little red box is navigation, and when the right arrow is clicked, the image advances to the next image. Clicking the back arrow cuases the obvious effect. (No clue how I'm going to do this either, but I try to go one step at a time when learning)
Not being trained in these things, I'm struggling to find the correct words to describe what I'm out for. Forgive me for being a little clueless.