473,395 Members | 1,458 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,395 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 13466
"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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.