View Single Post
Old 04-27-2005, 12:20 PM   #5 (permalink)
arch13
Loves my girl in thongs
 
arch13's Avatar
 
Location: North of Mexico, South of Canada
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.
__________________
Seen on an employer evaluation:

"The wheel is turning but the hamsters dead"
____________________________
Is arch13 really a porn diety ? find out after the film at 11.
-Nanofever
arch13 is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360