There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
Random Image Script


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
webdiva's Avatar
Member with 52 posts.
 
Join Date: Dec 2004
18-Mar-2005, 01:37 PM #1
Random Image Script
Hi,

For class I need to create an adoption agency website. On the main page I need it to include a "Featured Child", randomly, so when you refresh a new one displays. I need all the information in a database. I have the information in the database, now I just need the information on how to display a random row of information from the table. I also am not too sure how to display the url link to the picture so that the Image shows.

Any help would be greatly appreciated, Thanks

Laura
jd_957's Avatar
Account Disabled with 1,224 posts.
 
Join Date: Dec 2004
18-Mar-2005, 02:05 PM #2
could you use the following? it looks like it would work.

http://jscode.com/js_random_image.shtml
webdiva's Avatar
Member with 52 posts.
 
Join Date: Dec 2004
18-Mar-2005, 02:37 PM #3
Nope, I wish I could, it would be so much easier. We have to use PHP/mqSQL and no javascript

Right now I have the following done:

http://lauras-webdesigns.net/adoption

It shows a featured child, but the PHP code for it displays all rows in the table. The actual URL to the featured child is: http://lauras-webdesigns.net/adoption/childinfo.php

I need to have it so that everytime the page is visited it shows a random child. Or even like I have the featured articles, a different article a day, I got that script from someone else and don't know how to implement the children into it.
Squashman's Avatar
Distinguished Member with 12,604 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
18-Mar-2005, 02:59 PM #4
I dont know what script you are using currenlty so I really cant help you with implementing it but here are a few other scripts you could try. I couldn't find any that use MySql. Seems like most of them just pull from a directory.

This looks promising but doesn't use MySql. But it does allow you to display text underneath the picture.
http://www.hotscripts.com/Detailed/36791.html

This one allows you to link a url to each image.
http://www.hotscripts.com/Detailed/35931.html

Edit: Found one with Php/MySql
http://www.designplace.org/scripts.php?page=1&c_id=13
__________________
I hate asking the same question twice!
How to ask questions the smart way!
Microsoft MVP - Windows Shell/User
jd_957's Avatar
Account Disabled with 1,224 posts.
 
Join Date: Dec 2004
18-Mar-2005, 03:18 PM #5
maybe this is it.http://www.weberdev.com/get_example-400.html

i found that here. http://www.weberdev.com/

having never built a web site. i can only search and read. so i am not one to get into the technical stuff with.
nonane's Avatar
Junior Member with 26 posts.
 
Join Date: Mar 2005
Location: Lexington, SC
Experience: Advanced
18-Mar-2005, 03:27 PM #6
PHP Problems
Quote:
Originally Posted by webdiva
Hi,

For class I need to create an adoption agency website. On the main page I need it to include a "Featured Child", randomly, so when you refresh a new one displays. I need all the information in a database. I have the information in the database, now I just need the information on how to display a random row of information from the table. I also am not too sure how to display the url link to the picture so that the Image shows.

Any help would be greatly appreciated, Thanks

Laura
Looks like you may need a PHP developer as well.
brendandonhu's Avatar
Distinguished Member with 15,988 posts.
 
Join Date: Jul 2002
Location: Ann Arbor, MI
Experience: Advanced
18-Mar-2005, 07:06 PM #7
Have MySQL count the number of rows in your table. Pick a random number of rows between 0 and the number of rows, and display the image with that ID number.
webdiva's Avatar
Member with 52 posts.
 
Join Date: Dec 2004
19-Mar-2005, 03:08 AM #8
Hi, I got it working, thanks for all your help

http://lauras-webdesigns.net/adoption
tsunam's Avatar
Senior Member with 1,246 posts.
 
Join Date: Sep 2003
Experience: Linux~su
20-Mar-2005, 03:35 AM #9
also of note you can do it with strictly CSS as well (gotta love css...and even IE will like that bit of css...unlike most of the stuff it does)
Reply


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

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
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 05:49 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.