question about GET HTTP/1.0\r\nHost: \r\nConnection: Close\r\n

Discussion in 'PHP' started by crazy.works, Feb 7, 2009.

  1. #1
    hello,
    i saw code yesterday which iam not able to understand how it work and what is the useful for it . i wish to got explain for the code and the its useful

    here is the code.

    
    
    $site_1 =  "www.site-1.com";
    $site_2 = "www.site-2.com";
    $agent_name = "name";
    
    $HTTP =  "GET $site_1 HTTP/1.0\r\nHost:$site_2\r\nConnection: Close\r\nUser-Agent: $agent_name\r\n";
    
    $HTTP .= "\r\n\r\n";
                     
    
    PHP:
    please help me ,thanks
     
    crazy.works, Feb 7, 2009 IP
  2. steelaz

    steelaz Peon

    Messages:
    47
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    This code doesn't do anything by itself, just assigning some strings to some variables, but it looks like it was used for example of fetching remote web pages.
     
    steelaz, Feb 7, 2009 IP
  3. crazy.works

    crazy.works Peon

    Messages:
    304
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanks for the reply and the explain , but i have one more thing that i need to understand .

    is it fetch the variables and the data from the $site_1 or the $site_2 ???? and what is the effect of the agent name ?? i mean when we change it what its the effect on the code ??

    i wish u can explain to me more about this , i will be thankful if u able to past any small works example to understand the useful for it and the real usage in the remote web pages

    thanks
     
    crazy.works, Feb 7, 2009 IP