Re: How to display a website content on another

From: Pedro Graca (hexkid_at_hotpop.com)
Date: 01/13/04


Date: 12 Jan 2004 23:29:53 GMT

Brian Murphy wrote:
> I have a php-based yahoo-like web directory.I wanna give webmasters
> the possiblity to integrate my whole directory in their websites with
> their own formatting.I wanna this inclusion to be possible to all
> kinds of websites (ASP,PHP,... or just HTML).There are basically two
> files in my website:
> -index.php : shows the main categories along with 3 sample
> subcategories.
> -index1.php : displays the subcategories and sites of categories
> (exactly like yahoo!).
> I wanna make possible the browsing of the categories from those
> websites.The user shouldn't notice this content comes from
> outside.However, I wanna be able to know how many users used my
> directory from those websites.Any help will be
> welcome!

If I understood you correctly, I'd do a page to download the categories
and links with various formats.
Something like
   download.php?format=html&categories=all
or download.php?format=csv&categories=php%2casp
or download.php?format=php&categories=html
...

Then download.php outputs the requested categories in the requested
format (maybe you should validate the requester first -- IP, cookie, add
a pwd to the URL, ...), and logs the request.

Of course, the requester may download the data once per week, but have
it viewed (more and more out-of-date) several times per day; you have no
way to force them to always use the more recent data.

If they request the format=html, with php, they'd do
include('http://www.yourdomain.com/download.php?format=html');
and have the data presented to their users the way you format it for
html;

with a request of format=csv, they'd get the data into a string and
parse and display it (or save into _their_ database), for example, they
might receive
"php","http://www.php.net/","The source for php data."
"asp","http://www.microsoft.com/","ASP at it's source."

with a request of format=php (my favourite!) they'd get the result of
your command:
<?php echo serialize($data_array); ?>
and they just do
<?php
$brian_data = unserialize(file_get_contents('http://www.yourdomain.com/download.php?format=php'));
?>
to have your data neatly packed into their $brian_data array :)

Hope I made sense,

Happy Coding!

-- 
            --= my mail box only accepts =--
            --= Content-Type: text/plain =--
            --=  Size below 10001 bytes  =--


Relevant Pages

  • Re: problems with PHP 5 on IIS 5.01
    ... Websites are uniquely named by IP:Port:HostHeader that they bind to, ... you should use the ISAPI version of PHP on IIS. ... I recieve an http 400 - Bad Request error. ...
    (microsoft.public.inetserver.iis)
  • Re: Securing an Email script
    ... request to our sales office. ... Since you do ZERO checking on the values it's nothing BUT security ... very powerful PHP function to validate form fields and other ...
    (comp.lang.php)
  • Re: Object Oriented Content System - the idea
    ... >I expected php to be smarter then that. ... >form like bytecode in memory for the next request. ... each action added some stuff to a "response" XML document. ... that map/object/data and formats it for HTML display using an includeed PHP ...
    (comp.lang.php)
  • Re: Securing an Email script
    ... request to our sales office. ... Since you do ZERO checking on the values it's nothing BUT security issues. ... very powerful PHP function to validate form fields and other strings - ...
    (comp.lang.php)
  • Re: Modular PHP
    ... How can I catch an event in PHP. ... Everything is done with XML, so you will want to be familiar with XSLT ... the function itentified by the Handler attribute in the above XML, ... It's also worth noting that all the XML parsing for the request map ...
    (comp.lang.php)