| PHP, MySQL General PHP questions. Or go to our PHPsuexec Forum >> |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread |
|
|
#1 (permalink) |
|
Registered User
Super #1
Joined in Mar 2005
Lives in Washougal, WA
1,306 posts
Gave thanks: 23
Thanked 39 times
|
In need of PHP help
What I like to do is have photos like:
/photos.php?id=(number) /thumbs.php?id=(number) http://www.wmcintosh.com/gallery.php Code used for above link... Code:
<?php
include('/home/xxxxxx/public_html/sources/config.php');
if(!isset($_GET['id'])){
include('content/gallery/' . '0.php');
}else{
if(file_exists('content/gallery/' .$_GET['id'] . '.php')){
include('content/gallery/' . $_GET['id'] . '.php');
}else{
echo 'Sorry, could not find the <strong>id=' . $_GET['id'] . '</strong> page.';
}
}
?>
Photos (fullsize and thumbs) will reside in 2 different directories, if I could get help for one of them, surely I could manage the other one. Would appreciate any assistance, thanks. |
|
|
|
|
|
#2 (permalink) | |
|
Surpass Fan
Comfy Contributor
Joined in Feb 2004
Lives in Norfolk, England
Hosted on Pass32
165 posts
Gave thanks: 22
Thanked 18 times
|
Quote:
The /gallery/[number].php file: what is in that file exactly? If it is a php file "returning" an actual jpg file then it has to have an header("Content-type: image/jpg"); line somewhere in the file (along with a few other lines as well to make it work). This file would be used in the <img> tags "src" attribute - instead of 1.jpg you have gallery.php?id=1 which appears to be how the page on the link you posted has been used. Hope this leads you in the right direction.... Cheers Jonathan
__________________
Server: Pass32 and dedicated server |
|
|
|
|
|
|
#3 (permalink) |
|
Registered User
Super #1
Joined in Mar 2005
Lives in Washougal, WA
1,306 posts
Gave thanks: 23
Thanked 39 times
|
Thanks for responding jdcopelin.
Sorry for your time, going back to .html pages, besides my site is only personal and doesn't warrant .php pages, perhaps another time, especially when I know more PHP, right now have other projects that need my attention. |
|
|
|
|
|
#4 (permalink) |
|
Registered User
Super #1
Joined in Mar 2005
Lives in Washougal, WA
1,306 posts
Gave thanks: 23
Thanked 39 times
|
Well, as posted on DSL Reports webmonks forum I deleted all .html files and kept all .php files, but the photo part can wait till I learn more, I did copy jdcopelin post for reference.
Was inspired to keep playing and learning PHP, mind you I am learning on my own. |
|
|
|
|
|
#5 (permalink) | |
|
Surpass Fan
Comfy Contributor
Joined in Feb 2004
Lives in Norfolk, England
Hosted on Pass32
165 posts
Gave thanks: 22
Thanked 18 times
|
Quote:
Cheers Jonathan
__________________
Server: Pass32 and dedicated server |
|
|
|
|
|
|
#6 (permalink) |
|
Senior Member
Super #1
Joined in Jan 2005
1,540 posts
Gave thanks: 69
Thanked 33 times
|
My friend Julie has a very small PHP script that does exactly what you're looking for. It requires just a tiny bit of tweaking, but she has it well labeled. Worth checking out if you want a simple gallery.
|
|
|
|
| This user thanks ceo for this great post! | wgm (October 31st, 2007) |
|
|
#7 (permalink) | |
|
Registered User
Super #1
Joined in Mar 2005
Lives in Washougal, WA
1,306 posts
Gave thanks: 23
Thanked 39 times
|
Quote:
Don't take it as bad, its quite opposite. |
|
|
|
|
|
|
#8 (permalink) | |
|
Senior Member
Super #1
Joined in Jan 2005
1,540 posts
Gave thanks: 69
Thanked 33 times
|
Quote:
No prob, sorry it didn't work for you -- I'll keep my eyes peeled for something else. |
|
|
|
|