SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jun 2006
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    php help to Check whether external website is displaying code

    Greetings everyone!

    I wonder if someone can help me.

    I am doing a web site that serves ads to other web sites. I need to find a way using php to check every 24 hours whether that other site is displaying the code (or displaying the ad). The code on the other site would be something like:

    <script type="text/javascript" src="http://www.mysite.com/somefile.php?some_string"></script>

    Any help would be greatly appreciated.

    Regards

    Anwaraa

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    $html file_get_contents("http://www.example.com");

    if (
    strpos($html"somefile.php?some_string") !== false) {
      echo 
    "Found the code.";
    } else {
      echo 
    "Didn't find the code.";

    Somethin' like that?

  3. #3
    SitePoint Member
    Join Date
    Jun 2006
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thanks Dan

    Hi Dan

    Thanks for your quick help. Much appreciated. Will give it a try.

    Regards

    Anwaraa


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
  •