#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Posts
    3
    Rep Power
    0

    Question JavaScript inclusion function


    I need some sort of script to do the next trick:
    i have a php webpage that generates something that i want to be included in other websites. Like a newsfeed that people can put on their webpage.
    Any ideas?
  2. #2
  3. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Oct 2001
    Location
    New Zealand
    Posts
    1,774
    Rep Power
    25
    XML data islands.. using XSLT, standard way of including news feeds. Otherwise:

    server-side includes,
    or:
    Make the php script output javascript, then people can include:

    <script type='text/javascript' src='http://www.cracku.com/newsfeed.php'></script>
  4. #3
  5. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Oct 2001
    Location
    New Zealand
    Posts
    1,774
    Rep Power
    25
    Yeah, it's a vulnerability that the <script> tag can read external XML files. This could be down to malicious code that could be carried in the XML. Microsft just alerts to this. Questions are:

    Would you like to an untrusted URL?
    Shouldn't the security of the XML file be the responsibility of the owner and not the browser?

    http://sec.greymagic.com/adv/gm001-ie/

    Use the <xml> tag instead:

    http://msdn.microsoft.com/library/de...ataislands.asp

IMN logo majestic logo threadwatch logo seochat tools logo