SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2006
    Posts
    71
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    RSS- PHP or Javascript?

    I am adding my first rss feed to a website and no nothing about it. I am wondering what is the difference between javascript and php? Is one more search engine friendly then the other?

  2. #2
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,495
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That depends on what you're trying to do. Are you trying to get the contents of the feed to display as part of the Web page? Or are you trying to create a feed?

    Either way, I'd go with PHP over JavaScript any day of the week. Not only can PHP generate the feed on the fly for you, but it can also parse an existing one and convert it to plain HTML.

  3. #3
    SitePoint Enthusiast
    Join Date
    Mar 2006
    Posts
    92
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dan,

    I just posted a similar question! Can you elaborate on why parsing the existing feed and converting it to plain HTML is better?

  4. #4
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,495
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah. I'll post the answer there.

    For the original poster, here's the link to your thread (for posterity's sake):
    http://www.sitepoint.com/forums/showthread.php?t=437274

  5. #5
    Twitter - @CarlBeckel busy's Avatar
    Join Date
    May 2004
    Location
    Richmond, VA, USA
    Posts
    819
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Sarahc33
    I am wondering what is the difference between javascript and php?
    They're both scripting languages, the main difference is where they're run.

    PHP is run on the server, BEFORE the web page is sent to the visitor's browser.

    Javascript is run by the browser, either DURING or AFTER the webpage is loading.

    An example of PHP is to process information sent by forms and add them to your database, or to select the appropriate article (out of hundreds) to display on a web page, like if you wanted to see the most recent one, or a specific article from a search, etc...

    An example of javascript is to make a section of text visible instantly when something is clicked on, or to validate form fields before they are allowed to be submitted, or a shortcut key that fills out certain form fields for you. Stuff that happens while you're looking at the webpage.

    I agree with Dan that PHP would me more appropriate for dealing with an RSS feed. With Javascript you have to worry about the small percentage of people that have it turned off.


Bookmarks

Posting Permissions

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