...

View Full Version : dynamically pulling info from other webpages



hoeyjope
03-22-2007, 03:23 PM
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?

CFMaBiSmAd
03-22-2007, 03:33 PM
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.

jarrodcf
03-22-2007, 07:06 PM
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_parse_intermediate.htm
if xml seems like it may work for you or just google/yahoo "php xml parsing".

iLLin
03-23-2007, 02:38 AM
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.

mlseim
03-23-2007, 01:24 PM
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&safe=off&q=alternate+css&btnG=Search

iLLin
03-23-2007, 05:18 PM
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&safe=off&q=alternate+css&btnG=Search

Is this on the wrong topic by accident?

CFMaBiSmAd
03-23-2007, 06:26 PM
No it is the right topic. You can create a "text" only version of a page by using CSS.

mlseim
03-23-2007, 06:48 PM
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.

iLLin
03-23-2007, 07:31 PM
Aww CSS owns all. I didnt know you could do that. Thx for that tip :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum