Changing Links Daily

A

Alric Knebel

I'm relatively new to HTML, and my coding at present is very fundamental. I
have a page on my website on which ten different buttons link to an MP3.
But the MP3 could change frequently, almost daily. Now, I've been looking
at CSS, but so far I haven't incorporated a single CSS into any of my pages.
Maybe I'm jumping to the wrong conclusion, but I was thinking that CSS is
the answer to my problem. Follow me a moment, and some of you guys probably
already have a solution to this.

Here's the deal. I have a short MP3. Rarely will they be more than a
minute long. I have a jpeg button you click on to activate the MP3. Now,
tomorrow, I might want to change that MP3. So far, with my limited
knowledge of HTML, I'll have to open the code in an editor and change the
name of the MP3, save the changed HTML file, then upload it to the site,
where the new code will overwrite the old code. This hardcoding is a clunky
way to do this. I know there's got to be a better way to do this than the
way I just described. Here's what I was thinking.

I was thinking that I'd have a generic name for the link in the HTML. For
example, I'll reference the MP3 in the HTML code as simply, say,
"current_sound.mp3." There are several buttons on this page with a
different sound associated with each button; you can imagine that this could
get very awkward and take up a lot of time if I wished for my site to stay
current. As in CSS, somewhere in the hardcoded page would be a reference to
some external file that would assign a value to "current_sound.mp3". The
external text file might have a line that says,
"current_sound.mp3"="C-SPAN-100504.mp3".

I would like to know two things. First, is what I'm suggesting possible?
Second, if it's possible, can you give me a hint as to what direction to go
in? What code am I looking for, what's it called?

In conclusion, I haven't worked yet in JavaSript, but I was thinking that
I'd create a small script that would list on one side the hardcoded filename
and in another column the actual file associated with each file name, which
would then write them all to the text file, then upload that text file to
the website, where the HTML page would access the information.

I hope I made this clear. Thanks for any help. For clarity, I've included
the page I'm talking about in the link below.

Alric Knebel
http://www.ironeyefortress.com/C-SPAN_loon.html
 
B

brucie

In alt.html Alric Knebel said:
I have a page on my website on which ten different buttons link to an
MP3. But the MP3 could change frequently, almost daily. Now, I've
been looking at CSS,

html describes a document and css adds styling to it so they're not what
you need. you need to use some giggly bits of sexy php
Here's the deal. I have a short MP3. Rarely will they be more than a
minute long. I have a jpeg button you click on to activate the MP3. Now,
tomorrow, I might want to change that MP3.

the easiest i can think of off the top of my head is to name your mp3s
the days of the week you want them to play.

sunday.mp3, monday.mp3, tuesday.mp3 etc etc etc

place them in the same directory as the html page that uses them.

in your html document use the following line:

<a href="<?echo strtolower(date(l)).'.mp3'; ?>">play my mp3</a>

save the html document with a .php extension so the server knows to
prase the above php before sending the page to the visitors browser.
the html page they receive will have the above php replaced with this:

<a href="thursday.mp3">play my mp3</a>

(obviously it will depend on what the day of week is)

all done automatically with no intervention from you. easy peasy
 
B

brucie

In alt.html brucie said:
you need to use some giggly bits of sexy php

just noticed your server is IIS so chances are you cant use young hip
and sexy PHP, you're probably stuck with bills dirty old whore ASP
 
N

nice.guy.nige

While the city slept, Alric Knebel ([email protected]) feverishly typed...
I'm relatively new to HTML, and my coding at present is very
fundamental. I have a page on my website on which ten different
buttons link to an MP3. But the MP3 could change frequently, almost
daily. [...]

How about you don't change the name of the mp3? Upload your mp3 file, then
change its name to something like "mp3oftheday.mp3" then the link <a
href="mp3oftheday.mp3">MP3 of the day</a> will always play the most recent
one. To keep an online archive, before you ftp the current mp3oftheday.mp3,
rename the exisiting one with its original filename.

Hope that helps,
Nige
 
W

WebcastMaker

just noticed your server is IIS so chances are you cant use young hip
and sexy PHP, you're probably stuck with bills dirty old whore ASP

why? just use it on iis.
 
A

Alric Knebel

nice.guy.nige said:
While the city slept, Alric Knebel ([email protected]) feverishly
typed...
I'm relatively new to HTML, and my coding at present is very
fundamental. I have a page on my website on which ten different
buttons link to an MP3. But the MP3 could change frequently, almost
daily. [...]

How about you don't change the name of the mp3? Upload your mp3 file, then
change its name to something like "mp3oftheday.mp3" then the link <a
href="mp3oftheday.mp3">MP3 of the day</a> will always play the most recent
one. To keep an online archive, before you ftp the current
mp3oftheday.mp3,
rename the exisiting one with its original filename.

Hope that helps,
Nige

Yes, I did think of that. I can just access it via FTP and rename the files
as I need them. But I was hoping it would be an opportunity to learn
something . . . SEXY (as Bruce put it). I did think of that first, just
naming the files according to the line I want them on, the most current file
in the code titled "current.mp3," and so on. As the files are named now,
they day of the call is embedded in the title. I was hoping to retain that
convention, just so I can avoid any mix-ups. But you guys have been a lot
of help.

Alric Knebel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top