473,231 Members | 1,680 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,231 software developers and data experts.

How to display a website content on another

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!
Jul 17 '05 #1
4 13449
"Brian Murphy" <ya******@yahoo.com> wrote in message
news:c3**************************@posting.google.c om...
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!

Well if you want total integration, don't botther with making a page, but
rather having data available via php to others so they can use it.

An example, lets say you have 4 catagories, so they call a file on your
server

getCat.php
----------
<?
header("Content-type: text/plain");
print "Cat-name-1\n";
print "Cat-name-2\n";
print "Cat-name-3\n";
print "Cat-name-4\n";
?>
so when the query your site, they will have the 4 cat names, then it up to
them to display it in thier site as they wish.

I use this with weather.com, I have a script that gets the weather info from
weather.com, but it is an an xml format and I show the data, after I parse
it out, on a page I create.
--
Mike Bradley
http://www.gzentools.com -- free online php tools
Jul 17 '05 #2
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 =--
Jul 17 '05 #3
That's what frames are for. If you want the content to appear in the page
itself, you would need to write a page that places the content in a
Javascript string, have the website link in that page and dynamically write
the content where they want it to appear.

Snippet to be inserted into their pages:

<script src="http://somewhere.com/content.js.php"></script>
<script> document.write(content_from_somewhere_dot_com); </script>

content.js.php:

<?php

// get the page
$html = file_get_contents("http://localhost/index.php");

// get the content inside the document body
if(preg_match('/<body.*?>(.*)<\\/body>/si', $html, $matches)) {
$content = $matches[1];
$js_str = addcslashes($content, "\\\r\n\t'");
echo "var content_from_somewhere_dot_com = '$js_str';";
}

?>

Uzytkownik "Brian Murphy" <ya******@yahoo.com> napisal w wiadomosci
news:c3**************************@posting.google.c om...
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!

Jul 17 '05 #4
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!


Welcome to the wonderful world of Web services!

If I understood your requirements correctly, you wish to a) send just the
data, so that the other site is able to format it in any manner, and b) to
be able to send different data according to the input from the website (eg.
if a visitor to the other site browses your directory, that site sends you a
different query for each directory).

The best way to do that is using XML. Make a PHP script which creates XML
output, based on the query -- just like you would make a PHP->HTML page,
only the data is formatted as XML. The exact format of the format of the
request and the response can be done in either of this three ways (ordered
by increasing universality and standards-compliance, and decreasing
complexity).

1. SOAP: The industry standard for Web services, as defined by W3C and other
bodies. However, it is so complex that I wouldn't recommend it for a company
any smaller than NASA or IBM.

2. XML-RPC: A "guerilla" Web services standard, originally designed by
Userland. A number of client and server implementations for various
platforms are available, and you can read all about it at
http://www.xmlrpc.org/

3. DYOWS, or 'do your own Web service': Basically, you create whatever XML
vocabulary best fits your data and then give each of your 'customers' (the
sites that use your service) brief instructions how to query the data and
what the result contain. The disadvantage of this approach is that you have
to tech your customers, while in other cases you just point them to the
service's URL, say them 'it uses XML-RPC' and let them think about it from
then on. However, for smaller services everything else might just be an
overkill, and this might be the best approach.

I'll let you decide what would be the best solution for you, although I
believe thae the choice will be between the last two options above.

Berislav
Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Follower | last post by:
Hi, I am working on a function to return extracts from a text document with a specific phrase highlighted (i.e. display the context of the matched phrase). The requirements are: * Match...
19
by: Erik Sandblom | last post by:
Hello I can't read the London & Continental Railways website and they have no email address to complain to. I tried calling them, but got put through to one guy who hung up, and another who had...
6
by: Prabhat | last post by:
Hi, I have seen some of the website will display same url even if we go to inner pages. In status bar we can see the url before click of the link but when trhe page loads the addressber url...
2
by: Rob Dob | last post by:
Hi, How do I go about installing another Web Site Project inside my existing VS2005 website project. I currently have both a forum WSP and my main WSP application within the same solution. Both...
18
by: fishwick | last post by:
I haven't really done any css in quite a while, and am banging my head against the wall trying get the rudimentary layout together of a church website home page to display correctly - I don't want...
2
by: crferguson | last post by:
I'm having a really odd issue. Recently my company has upgraded our data server. For a couple of months I'm having to host two versions of the same website on our webserver until the new data...
2
by: Evan M. | last post by:
Hello there, I have an interesting problem to takle. I'm creating a website that's going to be run in a local Intranet. The site uses a MasterPage / content page scheme, with the Master page...
17
by: seajay | last post by:
Hello, I noticed something strange when I was composing a XHTML document with CSS The following DOCTYPE causes the page to display differently on Fireflox 1.0.6 and Internet Explorer 6...
2
by: hmchkus | last post by:
Hi, How can I integrate part of information from another website on my page? For example, a table of schedule, weather, stock info... I would like to know both way: 1. redirect the client...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.