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 9 of 9
  1. #1
    New to the CF scene
    Join Date
    Nov 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    dynamically pulling info from other webpages

    Alright I'm not a guru at php but I have a decent grasp on the capabilities of it. I want to be able to have a text only site to go along with my website. Is there any way to gather certain areas of text from my main site and display them in the text-only site. My website is growing so big that making updates to both of the sites has become very tedious and time consuming. Any ideas or if this is possible?

  • #2
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,024
    Thanks
    2
    Thanked 314 Times in 306 Posts
    If these are both pages/sites within the same domain, it is much better to just have each web page/site display the same content through something like a PHP include or from database entries.

    If you actually "fetch" the content from one site in real time and display it on another site, there is an additional delay for the http request to the server (even if it is the same server) and for that content to be served up by that server, received by the requesting server, processed, and output to the browser.

    If you provide a little more specific information about what the setup is, someone can provide a more specific answer on how to do this in your situation.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #3
    New to the CF scene
    Join Date
    Apr 2006
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    you may want to use xml, perhaps?

    if you can format your content (whether that content be headlines of some sort, articles, or whatever else) as xml, this may be the solution to your problem. you would basically need site A (the site you'll be updating regularly) to dynamically create an xml feed of said content. Then, on site B, use some PHP code to parse the xml file/data from site A.

    try this ->
    http://www.kirupa.com/web/xml_php_pa...termediate.htm
    if xml seems like it may work for you or just google/yahoo "php xml parsing".

  • #4
    Regular Coder
    Join Date
    Oct 2005
    Location
    Right Here
    Posts
    654
    Thanks
    1
    Thanked 0 Times in 0 Posts
    file_get_contents

    Then put in markers where you want to pull such as

    <!-- BOF_Main -->

    <!-- EOF_Main -->

    But in your case I would use xml and it would allow other users to subscribe to your news and display it on there site as well. More benefits.

  • #5
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,468
    Thanks
    8
    Thanked 1,085 Times in 1,076 Posts
    Also look at the possibility of using "alternate CSS" style sheets.
    A CSS for your page, another CSS for "printer friendly" or "no images".

    http://www.google.com/search?hl=en&s...ss&btnG=Search

  • #6
    Regular Coder
    Join Date
    Oct 2005
    Location
    Right Here
    Posts
    654
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by mlseim View Post
    Also look at the possibility of using "alternate CSS" style sheets.
    A CSS for your page, another CSS for "printer friendly" or "no images".

    http://www.google.com/search?hl=en&s...ss&btnG=Search
    Is this on the wrong topic by accident?

  • #7
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,024
    Thanks
    2
    Thanked 314 Times in 306 Posts
    No it is the right topic. You can create a "text" only version of a page by using CSS.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #8
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,468
    Thanks
    8
    Thanked 1,085 Times in 1,076 Posts
    And using Alternate CSS would save you a ton of time ....

    You don't need to insert any special codes into your pages,
    and don't need to parse anything. In my opinion, this would
    be the best way to provide a text only version of ANY page.

    illin also made a good point about RSS feeds. A good idea too.
    Last edited by mlseim; 03-23-2007 at 06:52 PM.

  • #9
    Regular Coder
    Join Date
    Oct 2005
    Location
    Right Here
    Posts
    654
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Aww CSS owns all. I didnt know you could do that. Thx for that tip


  •  

    Posting Permissions

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