Can Anyone Help Me !!!!!

Discussion in 'HTML & Website Design' started by geekazoid, Jul 5, 2006.

  1. #1
    I have been posting the same question on forums all over the net and no matter how hard people try, No one has answerd it. can you put me out of my missery.

    Im looking for a script i think, it may be something else, I just want to find something to do what i ask. ok heres what im looking for

    On my homepage i have a table ( 1 row by 1 colum ) ok so its more of a box. In this box i wish to have a randomised script. Yes ? A script that searches though say 200 .html files to randomly pick one, And here the tricky part, Per Day !

    So im looking for something to change each day, and it needs to have a folder with about 200 .html files in it and each day it will randomly select one to "Include" on my index.php homepage.

    im planing to use this for something like picture of the day where i will create 200 .html files which each have one picture and some text underneath that picture and they will randomly change each day. Hopefully.

    Now i have explained this before and kind people have given me scripts with no information on how to use them, This is where my threads fail. People assume i am some wizzard with php, which im not, But im willing to follow information if simple enough for me to follow.

    Can you put me out of my missery, I have been searching for this for a couple weeks now, and i have recieved is confusing replies and partranising emails. Im not an expert with php or MYSQL but i am willing to follow instructions. I will be very gratefull if anyone can help me get this done. Thankyou so much for your time to read this far. :)
     
    geekazoid, Jul 5, 2006 IP
  2. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #2
    OK, I think the best thing to do (assuming you have MYSQL?) is to first install phpmyadmin.
    Then you create a table with 2 columns. The first column needs to be a number ranging from 1 to 200. This is a unique id for your image. the second is the text that needs to be added underneath the image.

    Next you name your images in the form 1.jpg, 2.jpg etc and store them on your site.

    Once you have this database you can pull the information at random onto your page on a daily basis. Eg starting today you select record 1 from the DB and tomorrow you select record 2.
     
    mad4, Jul 5, 2006 IP
  3. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #3
    With such titles, you aren't going to get much attention. You may want to revise your strategy. And ironically, on DP it clearly says 'Don't type something like "Help Me" - use descriptive titles'.

    Anyway, good luck, mad4 the super legend is on the case.
     
    T0PS3O, Jul 5, 2006 IP
  4. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #4
    If you install phpmyadmin and let me have the password I will create the DB for you. Its only a 2 minute job.
     
    mad4, Jul 5, 2006 IP
  5. geekazoid

    geekazoid Peon

    Messages:
    208
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thankyou so much for helping so far Mad4 but im wondering will that randomise images where as im looking to randomise .html files with images and hyperlinked text ?? and maybe have the images linked aswell ?

    Is there anyway of doing this with .html files ?
     
    geekazoid, Jul 5, 2006 IP
  6. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #6
    You can do this with html files but that will be much harder. You would need to manually create & maintain 200 html files and name them in such a way (1.html, 2.html etc) that php can call them using a corresponding variable.

    Also pulling in a html file is not search engine friendly.
     
    mad4, Jul 5, 2006 IP
  7. imagenesis

    imagenesis Active Member

    Messages:
    273
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    60
    #7
    This is exactly why databases were invented :)
     
    imagenesis, Jul 5, 2006 IP
  8. Old Welsh Guy

    Old Welsh Guy Notable Member

    Messages:
    2,699
    Likes Received:
    291
    Best Answers:
    0
    Trophy Points:
    205
    #8
    Meaning what?
     
    Old Welsh Guy, Jul 5, 2006 IP
  9. geekazoid

    geekazoid Peon

    Messages:
    208
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9

    Surly i wouldnt have to maintain them, after i have created all 200 .html files there done and i can just let the rotation happen right ?
     
    geekazoid, Jul 5, 2006 IP
  10. brian394

    brian394 Well-Known Member

    Messages:
    226
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    108
    #10
    brian394, Jul 5, 2006 IP
  11. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #11
    You don't have to maintain them but what happens in the future if you want to alter the format or the text colour or something? You would need to edit 200 html files!
     
    mad4, Jul 6, 2006 IP
  12. geekazoid

    geekazoid Peon

    Messages:
    208
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    That is correct, and that is a chance im willing to take. Mad4 do you know of someway to randomise .html files

    p.s Thankyou Mad4 for all you help in this thread and others i have posted :D
     
    geekazoid, Jul 6, 2006 IP
  13. geekazoid

    geekazoid Peon

    Messages:
    208
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #13
    Yes brian364 but like everyone else you gave me a piece of script with no information on how to use it or where to put it. Im sure what you gave me would of worked i just need a little guidence :)
     
    geekazoid, Jul 6, 2006 IP
  14. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #14
    I don't know of any way to randomise html files. I stopped using html files quite some time ago (shortly after I discovered mysql and php).

    All of the things I have been helping you with would have been solved in 2 minutes if you used databases rather than html. Its a big jump but totally worth it. Some of my sites have 100,000 pages and just one template page to edit.
     
    mad4, Jul 6, 2006 IP
  15. geekazoid

    geekazoid Peon

    Messages:
    208
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #15
    ok but would i be able to make my text hyperlinkable ?
     
    geekazoid, Jul 6, 2006 IP
  16. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #16
    If you want.
     
    mad4, Jul 6, 2006 IP
  17. geekazoid

    geekazoid Peon

    Messages:
    208
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #17
    Brilliant That sounds perfect. Ok mad4 how would i go about doing this then, I have allready set up mysqladmin thingy and i got as far as creating a new table
     
    geekazoid, Jul 6, 2006 IP
  18. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #18
    OK, populate your table with 10 rows numbered from 1 to 10. Then upload images 1.jpg, 2.jpg to an images folder.

    Then add your text to go with each of the 10 images.
     
    mad4, Jul 6, 2006 IP
  19. geekazoid

    geekazoid Peon

    Messages:
    208
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #19
    ok i have made a table in my database called picture of the day and i have uploaded the 10 pictures to my server in a folder named POTDS and i renamed the piks like so

    1.jpg
    2.jpg
    3.jpg
    4.jpg
    5.jpg
    6.jpg
    7.jpg
    8.jpg
    9.jpg
    10.jpg

    Is this correct so far ?
     
    geekazoid, Jul 6, 2006 IP
  20. donnareed

    donnareed Peon

    Messages:
    340
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #20
    To get the part about only changing the image once per day, all you'd need to do is set up a Cron job to call up your randomizer script every 24 hrs. It is easy to do if you have CPanel on your webhost.
     
    donnareed, Jul 6, 2006 IP