View the source of a web page using a script?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Matt Traxinger

    View the source of a web page using a script?

    This is probably some really basic operation, but how do I view the source
    of a web page using a php script.

    For example I want to have a variable, say

    $url = "www.google.com ";

    Then I want to echo its source code, so that I have a page showing:

    <html>
    <head><title>Wh atever</title></head>
    <body>
    ..
    ..
    </body>
    </html>

    Thanks


  • Pedro Graca

    #2
    Re: View the source of a web page using a script?

    Matt Traxinger wrote:[color=blue]
    > This is probably some really basic operation, but how do I view the source
    > of a web page using a php script.
    >
    > For example I want to have a variable, say[/color]

    <?php
    [color=blue]
    > $url = "www.google.com ";[/color]

    $url = 'http://' . $url . '/';
    /*
    [color=blue]
    > Then I want to echo its source code, so that I have a page showing:
    >
    > <html>
    > <head><title>Wh atever</title></head>
    > <body>[/color]

    */

    echo htmlentities(fi le_get_contents ($url));
    ?>
    --
    USENET would be a better place if everybody read: : mail address :
    http://www.catb.org/~esr/faqs/smart-questions.html : is valid for :
    http://www.netmeister.org/news/learn2quote2.html : "text/plain" :
    http://www.expita.com/nomime.html : to 10K bytes :

    Comment

    • Chung Leong

      #3
      Re: View the source of a web page using a script?

      "Pedro Graca" <hexkid@hotpop. com> wrote in message
      news:c4hs4j$2j0 fr2$3@ID-203069.news.uni-berlin.de...
      [color=blue]
      >
      > echo htmlentities(fi le_get_contents ($url));
      >[/color]

      or show_source($ur l);


      Comment

      Working...