Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    mat
    mat is offline
    Regular Coder
    Join Date
    Jul 2002
    Posts
    199
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy dynamic button links ?

    -say you are making a fake site(for learning), an online cd/vinyl store with around 50 cds.
    -you have made 50 html pages, one for each album.
    -you have a database in access with one field that has the appropriate link to the html page for each and every record and the same for the soundclips. i.e

    "artist | title | sound | link|
    blah, blah, blah.mp3, 10.html

    now you attempt to make a search + resluts page with asp.


    how the hell exactly do i get the sound(speaker) buttons and the details(magnify) buttons next to each item to dynamically link to the correct html page and soundclip? is there any simple way of doing this?
    Last edited by mat; 07-18-2002 at 08:04 AM.

  • #2
    mat
    mat is offline
    Regular Coder
    Join Date
    Jul 2002
    Posts
    199
    Thanks
    0
    Thanked 0 Times in 0 Posts
    anyone?

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    Cincinnati, OH
    Posts
    545
    Thanks
    0
    Thanked 0 Times in 0 Posts
    All of this information should be stored in your database. I do not understand why you would code 50 pages if you are going to use a db and ASP. Do the link names have the artist name in them? If they do you can do something like

    <%
    While Not rs.EOF
    If InStr(rs("link") ,"Artist") <> 0 Then
    Response.Write(rs("link"))
    End If
    rs.MoveNext
    Wend
    %>

    That will probaly not be accurate all the time because the field link is in no way connected to the hard coded html pages.

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    Northern NJ
    Posts
    404
    Thanks
    0
    Thanked 1 Time in 1 Post
    did allida77 answer your question??
    I would rather be a lion for a day than a lamb that lives forever.

  • #5
    mat
    mat is offline
    Regular Coder
    Join Date
    Jul 2002
    Posts
    199
    Thanks
    0
    Thanked 0 Times in 0 Posts
    sorry, all a little over my head, the links to all the html pages are like 01.html, 02.ht.. etc...

  • #6
    Regular Coder
    Join Date
    Jun 2002
    Location
    Cincinnati, OH
    Posts
    545
    Thanks
    0
    Thanked 0 Times in 0 Posts
    There is no way to do this in a simple way. You are going to have to hard code every single link and you will not need asp or a db. If you added a field in your db called aritst then it would make this very easy.

  • #7
    mat
    mat is offline
    Regular Coder
    Join Date
    Jul 2002
    Posts
    199
    Thanks
    0
    Thanked 0 Times in 0 Posts
    well i do have a feild in the DB called "artist" that is where the artist's names are stored, but the links do not have the artists name in them...

    i know this is an unrealistic way of doing things but i am very new to this and by the time i would have learnt how to make that one "more details.asp" page it would be too late i had to learn how to do all the rest so i decided just for this first time as just for the purpose of having work to stay up and make all of those individual html pages, now i would like to use them.

    (this is fake but still a project for design college, i have already handed it in but i can redo, it's just they are focusing mostly on
    the design side as opposed to the scripting-backend side of things so i am pretty much on my own doing this)

    perhaps i could now make one asp page? but that would mean i have to make heaps of tables , one for each and every album that contains the tracklisting, also for the soundclips and album covers right? this would take even more time, not to mention it would perhaps also be over my head getting it all to work.....

  • #8
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Like allida said, you'd be much better off doing all of this with a database (or more likely a set of related databases), and making perhaps ONE page to do all the work for you.

    This kind of information/reporting, etc. is what relational databases are DESIGNED to do for you.

    If you're completely new to databases, I'd check out webmonkey.com's relational database tutorial, that should get you started!

    Believe me, in the long run you'll be VERY glad you did, since you don't have all of those hard-coded pages to potentially have to edit... my advice - throw all of your ".html" pages in your virtual "File 13", and create everything dynamically on the fly from your database(s)... using 1 or a few dynamic .asp pages... it's MUCH much easier - and not as hard as you might think. If I can do it, so can you...

    If you only have 50 cd's, I'd probably just use one database, and have a field for the CD "ID" (Probably the Primary Key), Title, Artist, Tracks, Description, Credits, Images (in a delimited string probably), and a field with the sound files stored in a delimited string or something...

    Then depending on the CD someone picked, you'd just pass that "CD_ID" in a querystring and write all this stuff to the page depending on what's in the database for that "CD_ID".

    You could split the stuff stored in a delimited string up into an array (or just scratch that idea, and use a related database, if you want to do it that way for learning purposes!) and bam!, you have all of your images, sound files, etc. ready to dynamically write to the page.

    This sounds hard if you've never done it... but it's not, really.:


    http://hotwired.lycos.com/webmonkey/backend/databases/


    Last edited by whammy; 07-25-2002 at 12:28 AM.
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #9
    mat
    mat is offline
    Regular Coder
    Join Date
    Jul 2002
    Posts
    199
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks for the all the info

  • #10
    mat
    mat is offline
    Regular Coder
    Join Date
    Jul 2002
    Posts
    199
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <CF OUTPUT QUERY>
    <a href="#link#"><img src="more_details_pic"></a>
    </CF OUTPUT>



    yup i'm gonna go with CF on this one


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •