What is the easiest way to rotate content in HTML?

Discussion in 'Programming' started by Pronet Hosting, Aug 3, 2009.

  1. #1
    I want my webpage to randomly display 100 articles, what is the easiest way to do?

    Anyone can help me? Thank you.
     
    Pronet Hosting, Aug 3, 2009 IP
  2. Pronet Hosting

    Pronet Hosting Active Member

    Messages:
    301
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #2
    Pronet Hosting, Aug 3, 2009 IP
  3. dimitar christoff

    dimitar christoff Active Member

    Messages:
    882
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    90
    #3
    Last edited: Aug 4, 2009
    dimitar christoff, Aug 4, 2009 IP
  4. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
  5. flakas123

    flakas123 Peon

    Messages:
    50
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I don't think that it's possible to do it in just html. I see just two methods - use PHP or Javascript. (Javascript example in post above this)
     
    flakas123, Aug 4, 2009 IP
  6. gbit

    gbit Active Member

    Messages:
    625
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    70
    #6
    Why don't you use PHP for randomly rotating articles? I would be easy to program!
     
    gbit, Aug 4, 2009 IP
  7. Zizzi

    Zizzi Peon

    Messages:
    67
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I'd have to agree with the others on this one. Some sort of script to rotate the content would be best. And it's not the hardest to do either.
     
    Zizzi, Aug 4, 2009 IP
  8. Pronet Hosting

    Pronet Hosting Active Member

    Messages:
    301
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #8
    I want to display a random article about 500 words but not just a few simple text.
    However, I don't want to change my webpage from .html to .php, can u do it?
     
    Pronet Hosting, Aug 4, 2009 IP
  9. premiumscripts

    premiumscripts Peon

    Messages:
    1,062
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #9
    You can use mod rewrite so that 1 html page is interpreted as PHP. The only solution you currently have is through javascript, and that would mean the content wouldn't be indexed by google.
     
    premiumscripts, Aug 5, 2009 IP
  10. dimitar christoff

    dimitar christoff Active Member

    Messages:
    882
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    90
    #10
    no need to mod rewrite it, you can just set a content handler for .html to go through to php (in httpd.conf) - but this can have a negative performance effect as it would invoke the php parser for each static .html page you have - and most of them won't have any PHP in them.

    you can load contents of articles dynamically via js of course (ajax etc) - but this wont help much in your SEO - need to be very careful in how you structure it so all articles are spidered.
     
    dimitar christoff, Aug 5, 2009 IP
  11. premiumscripts

    premiumscripts Peon

    Messages:
    1,062
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #11
    dimitar, I meant using mod_rewrite to rewrite 1 specific .html to be parsed by PHP. This would not have the negative performance effect you describe.
     
    premiumscripts, Aug 5, 2009 IP
  12. dimitar christoff

    dimitar christoff Active Member

    Messages:
    882
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    90
    #12
    yeah, fair enough. although I have an inkling he won't be upto the task either way...
     
    dimitar christoff, Aug 5, 2009 IP
  13. Pronet Hosting

    Pronet Hosting Active Member

    Messages:
    301
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #13
    If I use mod_rewrite and Php, will my webpage be indexed by the Google?
     
    Pronet Hosting, Aug 5, 2009 IP
  14. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #14
    Offcourse it will
     
    Bohra, Aug 5, 2009 IP
  15. 1 FineLine

    1 FineLine Peon

    Messages:
    78
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #15
    why not Javascript?

    I believe you could locate a directory on your server where the articles are based and just add the random method to show them.
     
    1 FineLine, Aug 5, 2009 IP
  16. Pronet Hosting

    Pronet Hosting Active Member

    Messages:
    301
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #16
    But how can I do that? Any script you can recommend? I'm not a programmer and I expect a free script or I can hire somebody who can do the job for me, please help.
     
    Pronet Hosting, Aug 6, 2009 IP
  17. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #17
    Mate its better u do this in php and using mod rewrite make it html if u dont know how to do it i can do it for a small fee
     
    Bohra, Aug 6, 2009 IP
  18. Pronet Hosting

    Pronet Hosting Active Member

    Messages:
    301
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #18
    Can u show me how your script work? Would u please install your php script at a webpage and show me how it work? I also need the random article to be indexed by Google and look fresh every time Google crawl my site, can u do that? Please also tell me how much for your services, thank you.
     
    Pronet Hosting, Aug 6, 2009 IP