Get code from another site

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Steve Ray

    #1

    Get code from another site

    Guys

    Not sure if this is possible but I'd appreciate a bit of info please

    I would like to (lets just call it) borrow a piece of code from another
    website. The website in question is published totally in Microsoft
    Frontpage, some very ancient version with totally flat HTML. (Not my site,
    not under my control. The owners have no interest in changing the site)

    Is it possible in PHP to take a piece of code from this website and
    reference it on my page, I was thinking of something along the lines of:

    GREP from sitename | referencing this page | inside these markers

    I've spoken with my web developers and they tell me I can use Iframe tags or
    RSS feeds, both of which I do not believe will allow me to accomplish this

    Thanks in advance

    Steve


  • Good Man

    #2
    Re: Get code from another site

    "Steve Ray" <nochance@all.c omwrote in
    news:f72qc7$fl9 $1@north.jnrs.j a.net:
    Guys
    >
    Not sure if this is possible but I'd appreciate a bit of info please
    >
    I would like to (lets just call it) borrow a piece of code from
    another website. The website in question is published totally in
    Microsoft Frontpage, some very ancient version with totally flat HTML.
    (Not my site, not under my control. The owners have no interest in
    changing the site)
    >
    Is it possible in PHP to take a piece of code from this website and
    reference it on my page, I was thinking of something along the lines
    of:
    >
    GREP from sitename | referencing this page | inside these markers
    >
    I've spoken with my web developers and they tell me I can use Iframe
    tags or RSS feeds, both of which I do not believe will allow me to
    accomplish this
    fread();

    or
    file_get_conten ts();



    Will let you get the content/source of a webpage...

    Comment

    • Geoff Berrow

      #3
      Re: Get code from another site

      Message-ID: <f72qc7$fl9$1@n orth.jnrs.ja.ne tfrom Steve Ray contained
      the following:
      >Is it possible in PHP to take a piece of code from this website and
      >reference it on my page, I was thinking of something along the lines of:
      >
      >GREP from sitename | referencing this page | inside these markers
      LOL, that would have been covered in the follow-up PHP course Steve. Had
      there been one. :-(

      It's called screen scraping. Experiment with this

      $html_content = implode('', file('http://www.example.com '));
      $begin="begin marker";
      $end="end marker";

      preg_match("/$begin(.*)$end/i", $html_content, $match[]);

      print_r($match) ;

      --
      Regards,

      Geoff Berrow

      Comment

      • PDannyD

        #4
        Re: Get code from another site

        Steve Ray wrote:
        Guys
        >
        Not sure if this is possible but I'd appreciate a bit of info please
        >
        I would like to (lets just call it) borrow a piece of code from another
        website. The website in question is published totally in Microsoft
        Frontpage, some very ancient version with totally flat HTML. (Not my site,
        not under my control. The owners have no interest in changing the site)
        >
        Is it possible in PHP to take a piece of code from this website and
        reference it on my page, I was thinking of something along the lines of:
        If your server allows it, try fsockopen.


        Comment

        Working...