Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Changing Links Daily

Reply
Thread Tools

Changing Links Daily

 
 
Alric Knebel
Guest
Posts: n/a
 
      10-07-2004
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


 
Reply With Quote
 
 
 
 
brucie
Guest
Posts: n/a
 
      10-07-2004
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

--
l i t t l e v o i c e s m a k e m e
 
Reply With Quote
 
 
 
 
brucie
Guest
Posts: n/a
 
      10-07-2004
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


--
l i t t l e v o i c e s m a k e m e
 
Reply With Quote
 
nice.guy.nige
Guest
Posts: n/a
 
      10-07-2004
While the city slept, Alric Knebel ((E-Mail Removed)) 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

--
Nigel Moss
http://www.nigenet.org.uk
Mail address not valid. http://www.velocityreviews.com/forums/(E-Mail Removed), take the DOG. out!
In the land of the blind, the one-eyed man is very, very busy!


 
Reply With Quote
 
WebcastMaker
Guest
Posts: n/a
 
      10-07-2004
In article <(E-Mail Removed)>, ****@usenetshit.info
says...
> > 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


why? just use it on iis.
--
WebcastMaker
Webcasting for free
http://www.webentations.com
http://www.webcastmaker.com (CBT)
 
Reply With Quote
 
Jeffrey Silverman
Guest
Posts: n/a
 
      10-07-2004
On Thu, 07 Oct 2004 15:08:47 +1000, brucie wrote:

> 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


Technically, of course, PHP predates ASP:

<http://en.wikipedia.org/wiki/Php#History>
<http://support.microsoft.com/default.aspx?id=fh;%5Bln%5D;lifeprodi>
(Note the life cycle of IIS 3 -- which was the first to ship with ASP)

later...
--
Jeffrey D. Silverman | (E-Mail Removed)
Website | http://www.newtnotes.com

Drop "PANTS" to reply by email

 
Reply With Quote
 
Alric Knebel
Guest
Posts: n/a
 
      10-07-2004

"nice.guy.nige" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> While the city slept, Alric Knebel ((E-Mail Removed)) 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


 
Reply With Quote
 
 
 
Reply

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
daily python url - gmane links dead? K.S.Sreeram Python 0 06-13-2006 06:47 PM
testking.co.uk updates daily MCSE 31 03-03-2004 11:17 PM
testking.co.uk daily updates wongh MCSD 9 01-23-2004 11:49 AM
testking.co.uk daily updates wongh MCSE 18 01-22-2004 03:57 PM
Our Daily Bread Web site and Mozilla 1.5 Indigo Moon Man Firefox 10 11-30-2003 06:33 AM



Advertisments