Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Please tell me there is an easier way... 1

Status
Not open for further replies.

annebooth

Technical User
Aug 25, 2003
15
US
I'm creating a website that will show about 15 rooms for every day of the year, with each room being individually linked to each day. Is there an easier way to link these together? Right now I am having to go to each room selection and manually link them to the appropriate day. Is there something that can choose the year, month, and day for me?

Thanks in advance,
Anne
 
So, you have some total number of rooms (say, 5475 rooms) and you want to show a different 15-count subset every different day for 365 days?

A task like this would -- it seems -- best be handled by a database with a list of all the images and the associated dates.

Do I understand the problem correctly?

Cheers,


[monkey] Edward [monkey]

"Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!" -- inventor of the cat door
 
Actually, what I need is something that will input a value for the year, month and day. There are only about 15 to 20 rooms, but a document for each room for each day.

To clarify: There are about 20 rooms that each record the temperature and humidity for that room and current day. This information is in turn supposed to be sent to a text document for future viewing. What I am doing is creating a list page for each day, with all of the rooms with links to the information.

Help? Please?
Anne
 
Okay...

So, for every day, there's a new text document with the temperature information for all 20 rooms?

Still with you, just want to make sure I understand...

Cheers,


[monkey] Edward [monkey]

"Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!" -- inventor of the cat door
 
You got it. So there will be 20 new documents with the same name for each day.
 
So, the person would select from, say, drop-downs: month (Jan, Feb, Mar, Apr...), a day (1, 2, 3...), and a year (1972, 1973, 1974,...) and those three values tie to some unique text document: 2002_Aug_17_Stats.txt and you'll just have a crapload of these text files on the website, with the count just growing by one per day as new text files are entered?

Am I closer? (if so, I've already got a pretty good idea how to solve this with client-side code, but I want to make sure I understand the parameters)

Cheers,


[monkey] Edward [monkey]

"Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!" -- inventor of the cat door
 
Well, in JavaScript, you can open a new window with whatever content you want, as long as it's on the server.

So, you compile a string to build this command using data from your dropdowns:

Code:
(pseudocode)

// Assuming the User has chosen their desired specs from drop-downs //

var Invocation = document.FormName.SelectYear.Value + "_" + document.FormName.SelectMonth.value + "_" + document.FormName.SelectDay.Value + "_Stats.txt";

// for example, 2002_Aug_17_Stats.txt //

Invocation = "var Statties = window.open('"+Invocation+"','smallwin','width=400,height=350,status=yes,resizeable=yes');"

// builds the new-window command such that it'll retrieve the file according to the value of Invocation //

eval(Invocation);

// Makes it happen, in accordance with prophecy //

I think something like that might do the trick without requiring you to add server-side programming and without you having to change the app each time. Be sure you're 404 routes to a page that reads something like "That date is not available." and then bounces them back after a few seconds.

Do you think that'll do the trick?

Cheers,


[monkey] Edward [monkey]

"Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!" -- inventor of the cat door
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top