Hi there
what I'm trying to do here is
[subject]
building a website that updates several other sites' content
such as some images and URL
hopefully it is not in the illegal arena
I have some idea in mind
just not sure if it is going to work
so i decided to post it here, see if anyone can give me some advice

[question?]
write a PHP to extract data I need from the sites, save it to a XML -> set a cron job letting the PHP auto-run -> in HTML, read the XML file

Q1. is it illegal??
Q2. how should I set the tag in the XML for HTML using?
Q3. is my idea going to work? can someone give me some hints if it doesn't?

thanks a lot for helping me out :)

Recommended Answers

All 5 Replies

I think the most simple solution would be to get the content in an <iframe> or use PHP's file_get_contents. If you want to save it take a look at fwrite (http://www.tizag.com/phpT/filewrite.php).

And for the refresh: <meta http-equiv="refresh" content="30">.

I don't know if it is illegal.

I hope the rest was helpful though!

can you explain more about the iframe part?
I'm not really getting it :(

OK, use an iframe to link to a PHP file that saves the current site.

........
<iframe src="run.php" width="0" height="0" frameborder="0" scrolling="no"></iframe>
........

The PHP file should look something like this:

........
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="refresh" content="30">.
<title>Title</title>
</head>

<body>

<?php

$file = file_get_contents('http://external.com/index.html');
$saves = fopen('saves.txt', 'w+');
fwrite($saves, $file);
fclose($saves);

?>

</body>
</html>
........

Then add a second iframe:

........
<iframe src="http://external.com/index.html" width="100%" height="100%" frameborder="0" scrolling="no"></iframe>
........

The first iframe handles the saving part (it creates a simple txt file with the contents of the website you want to display, it is invisible). The second one shows the site in a visible form.

wow that was clear and helpful!
thanks a lot!!
I'll work on it and see if any more problems come out

I never use iframe tag but now i will try it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.