Dynadot โ€” .com Transfer

Allowing other sites to use my content?

Spacemail by SpaceshipSpacemail by Spaceship
Watch

boomers

Established Member
Impact
4
I have recently made a script that gather news headlines automatically every couple of hours and lists them in a datalist- I want to allow other people to have the option to having these news headlines on their websites, in the same way that The Free Dictionary allow other sites to use parts of their content. ( http://www.thefreedictionary.com/lookup.htm#sitecontent )

- Ive had a look at how The Free Dictionary do this and as far as I can tell its done using JavaScript includes, Ive looked into using this option but I would need my script to convert the news headlines from HTML to JavaScript and this is something I have no idea to do (ive little to no knowledge of JavaScript)

Does anyone have any ideas on how I can acheive my goal of allowing other sites to use my content - any opinion/ideas are appreciated :)
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
What you can do is create a page .. lets call it content.php and your content will be news headlines
Then basically you loop thru your records
basic example:
PHP:
$query = 'SELECT * FROM news';
$result = mysql_query($query);
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
?>
document.write('<div><?php echo $line[news_title];?></div>');
document.write('<div><?php echo $line[news_introduction];?></div>');
document.write('<div><?php echo $line[news_link];?></div>');
document.write('<br/>');
<?php }?>
of course you can do this all within the php tags without leaving them for the sake of examples, there it is.

Then they add
HTML:
<script language="javascript" src="http://www.yourwebsite.com/content.php"></script>
whereever they need the content
 
Last edited:
0
•••
Dynadot โ€” .com TransferDynadot โ€” .com Transfer
Appraise.net
Spaceship
Domain Recover
NameMaxi - Your Domain Has Buyers
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back