Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jul 7th, 2005, 1:49 PM   #1
dmorales
Programmer
 
Join Date: Feb 2005
Posts: 74
Rep Power: 4 dmorales is on a distinguished road
picture viewer

I was wanting to put a picture viewer on one of my pages. I was wanting to see if I could write it in php, although it would probably be a lot easier in javascript.

How would I go about doing this? some psuedo code would be great! I've been thinking about it but haven't got it all down as to what I will need? Any suggestions, or just doi it in javascript.
__________________
Lorem ipsum dolor sit amet...
dmorales is offline   Reply With Quote
Old Jul 7th, 2005, 2:28 PM   #2
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,473
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
1) pictures / links to pics in a MySQL database...
2) loop through the database records sequentially or randomly
3) display in website, with PHP code for layout and thumbnails, searching...
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Old Jul 7th, 2005, 2:44 PM   #3
dmorales
Programmer
 
Join Date: Feb 2005
Posts: 74
Rep Power: 4 dmorales is on a distinguished road
OK but but how do I write the part to display the picture? do I stick the query in an <img src> tag?
__________________
Lorem ipsum dolor sit amet...
dmorales is offline   Reply With Quote
Old Jul 7th, 2005, 2:57 PM   #4
skuinders
Hobbyist Programmer
 
skuinders's Avatar
 
Join Date: Jun 2005
Location: MA, US
Posts: 204
Rep Power: 4 skuinders is on a distinguished road
Quote:
Originally Posted by dmorales
OK but but how do I write the part to display the picture? do I stick the query in an <img src> tag?
you do the query with php and that will return a rowset... you want to loop through each row in that and assuming you have a field that contains the relative location of the image on the server, you would store that value in a variable and then use it in your img src tags

something like:
<?php
   print "<img src=\"$location\"/>";
?>
__________________
"A stupid man's report of what a clever man says can never be accurate, because he unconciously translates what he hears into something he can understand."
- B. Russell

http://web.bryant.edu/~srk2
skuinders is offline   Reply With Quote
Old Jul 8th, 2005, 9:46 AM   #5
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,473
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
Yep... the <img src> tags... Skuinders hit it right on the money...
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Old Jul 11th, 2005, 9:41 PM   #6
dmorales
Programmer
 
Join Date: Feb 2005
Posts: 74
Rep Power: 4 dmorales is on a distinguished road
Thanks, I've already got started and if I have any questions I new exactly where to ask it!
__________________
Lorem ipsum dolor sit amet...
dmorales is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:36 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC