SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2002
    Location
    Orlando, Florida
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP Include, iFrame, or AJAX - Help, Please

    I'm trying to do something simple - I think - but can't decide the best way to implement it.

    A client's Web site has two columns - the left column choose authors alphabetically, topics by theme, etc. And the right column displays the results.

    The current version of the site is a labyrinth of static pages.

    The new work order calls for ONLY the right column (the results column) to update when the users makes a selection from the left column.

    What is the best way to accomplish this feat: PHP includes, iframes, or AJAX?

    Note that the site does not have a database. It is a vast collection of static pages. (The client does not want a database.) By making the results pages dynamic, I should be able to eliminate most of the redundant information on those pages and keep just a single, insertable DIV. That's the plan, anyway.

    I appreciate the help!

  2. #2
    ✯✯✯ silver trophybronze trophy php_daemon's Avatar
    Join Date
    Mar 2006
    Posts
    5,284
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    If there are only static pages then I suppose the pages are full and include both columns as well as the header, footer etc. In this case you cannot update only the right column without organizing the data.

    Now I don't know how complex the data hierarchy is, but you can try making data only html pages, which you can then include in the right column.

    Once you have the data files ready, you can use AJAX to deliver it to the user. I say AJAX because I think it's the most efficient solution. You can't use PHP includes as you would have to refresh all page. iframes would hurt your SEO. You can use AJAX to get the required file contents and output to your div.

    Also note that it would still hurt your SEO as you will only have one crawlable page. And you will have that one page if you place the initial content to your right column without the help of AJAX. SE spiders still recognize only simple javascript, AJAX is not simple.
    Saul

  3. #3
    SitePoint Enthusiast
    Join Date
    Sep 2002
    Location
    Orlando, Florida
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There appears to be no ideal solution...

    The right column data is text only, and not much of it.

    If PHP, iframes, and AJAX aren't ideal solutions, and if they would all cause the site to take a hit in the search rankings, is there any good, simple way to insert text data into a DIV on a page without reloading the rest of the page?

  4. #4
    SitePoint Enthusiast
    Join Date
    Sep 2002
    Location
    Orlando, Florida
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Possible solution:

    http://www.dhtmlgoodies.com/scripts/...-articles.html

    This script seems to do what I want. Are there any drawbacks?

    Will search engines be able to crawl all of the content on the site, even the content generated by the AJAX script?

  5. #5
    ✯✯✯ silver trophybronze trophy php_daemon's Avatar
    Join Date
    Mar 2006
    Posts
    5,284
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Well, this example is a typical use of AJAX. And no, search engines will not be able to crawl all articles. Search engines are deficient at this point, and the best SEO is having all different pages for each article.
    Saul

  6. #6
    Keep it simple, stupid! bokehman's Avatar
    Join Date
    Jul 2005
    Posts
    1,933
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'd probably store the right column in a database and have the left column as a template. Each link would lead to a full page created by php... but each link would also have a javascript event handler. This would call the same php file but this time that file would only output the contents of the right column and Javascript would handle the update. Now the site would work all ways. SE and people without Javascript would follow the links and the rest would have AJAX. Also on each AJAX page you should have the direct URL of that page so it can be called directly by url alone or bookmarked.


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
  •