SitePoint Sponsor

User Tag List

Page 3 of 3 FirstFirst 123
Results 51 to 54 of 54
  1. #51
    That's Right. notepad_coder's Avatar
    Join Date
    Apr 2002
    Location
    Colorado
    Posts
    835
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well I got another one. This one I did for another thread on here and it may have some good use, but I will probably never use it.
    PHP Code:
    <?
    function format($p$url) {
        
    $p preg_replace("#(src=\"|SRC=\"|src=|SRC=)(.*?)((\"?))#i""$1$url/$2$3"$p);
        
    $p preg_replace("#(<link)(.*?)(href=\"|HREF=\"|HREF=|HREF=)(.*?)((\"?))#i""$1$2$3$url/$4"$p);
        
    $p preg_replace("#(<form)(.*?)(action=\"|ACTION=\"|action=|action=)(.*?)((\"?))#i""$1$2$3$url/$4"$p);
        
    $p preg_replace("#(<a)(.*?)(href=\"|HREF=\"|HREF=|HREF=)(.*?)((\"?))#i""$1$2$3$url/$4"$p);
        
    $p preg_replace("#(background=\"|BACKGROUND=|background=|BACKGROUND=)(.*?)((\"?))#i""$1$url/$2$3"$p);
        return 
    $p;
    }
    $url "http://www.example.com";
    $uri "http://www.example.com/index.php";
    $fp fopen($uri"r");
    while (!
    feof($fp)) {
        
    $line fgets($fp4096);
        echo 
    format($line$url);
    }
    ?>
    It will open a URL and then print it out like it was in the file. The preg_replace() had to be used since the images, styleshheets and things like that wouldn't show up properly.

    It doesn't work that well but it gets the job done.
    Last edited by notepad_coder; Jul 4, 2002 at 03:12.
    - the lid is off the maple syrup again!

  2. #52
    SitePoint Enthusiast
    Join Date
    Jan 2004
    Location
    Bologna (Italy)
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You nasty lil bas$%!$

    HarryF, you packed a bomb with your include script. It's a temptation to test it... but not on my pc, of course.

  3. #53
    perfect = good enough peach's Avatar
    Join Date
    Jun 2004
    Location
    -Netherlands-
    Posts
    1,384
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mdsjack
    You nasty lil bas$%!$

    HarryF, you packed a bomb with your include script. It's a temptation to test it... but not on my pc, of course.
    cool thread, but did you realize it's 3 and a halve years old

  4. #54
    SitePoint Enthusiast
    Join Date
    Jan 2004
    Location
    Bologna (Italy)
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by peach
    cool thread, but did you realize it's 3 and a halve years old
    uahahahah...

    well I ended up here while searching "setlocale"...


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •