Results 1 to 5 of 5

Thread: [RESOLVED] Variable from remote page

  1. #1

    Thread Starter
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Resolved [RESOLVED] Variable from remote page

    basicly, i am trying to get a variable from a page on my server. I am doing this as copyright protection... but i cant seem to pass a variable from my page on the server, to the other page... here is my code:

    PHP Code:
    include("http://verify.subsoft.net/urlsnipper.php");
    if(
    $verify == "") {
        echo 
    $copyright;
        echo 
    "This site is no longer valid. Please contact SubSoft for more information.";

    My usual boring signature: Something

  2. #2
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629

    Re: Variable from remote page

    you can't do that (at least not the way you want to). if you include a HTTP URL, you're including a PHP file that has already been parsed and turned into HTML/plain text by PHP. no variables really exist in it anymore. you need a copy of the script locally to be able to do what you want.

  3. #3

    Thread Starter
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: Variable from remote page

    oh ok. Well the purpose of the file is to test to see if the copy they have is legit and that they didnt remove the copyright notice.
    My usual boring signature: Something

  4. #4
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629

    Re: [RESOLVED] Variable from remote page

    well, then you could just save the text of that page to a variable and search for the text that's supposed to be there.

    PHP Code:
    <?php
      $str 
    "copyright blah blah blah";
      
    $page file_get_contents('http://website.com/page.php');
      if(
    strpos($page$str) !== false){
        
    //it's there
      
    }else{
        
    //not there
      
    }
    ?>

  5. #5

    Thread Starter
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: [RESOLVED] Variable from remote page

    oh ok. Thanks
    My usual boring signature: Something

Posting Permissions

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



Click Here to Expand Forum to Full Width