Debug My Script! Help out a PHP newbie

Discussion in 'PHP' started by Drej, Aug 1, 2007.

  1. #1
    Hey guys, I'm trying to run this script, but whenever I run it I get the following error

    
    Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/drkicks/public_html/test.php on line 51
    
    Code (markup):
    The script is as follows
    
    <?php
    
    
    
    // the site we want to attack
    
    $host = "www.testme.com"; 
    
    
    
    // the file we want to attack
    
    $file = "specials.htm";
    
    
    
    // construct a header for our request
    
    $hdrs = array( 'http' => array(
    
        'method' => "POST",
    
    
    
        header'=> accept-language: en\r\n" . 
    
            "Host: $host\r\n" .
    
            "Referer: http://$host\r\n" .  // Setting the http-referer
    
            "Content-Type: application/x-www-form-urlencoded\r\n" .
    
            "Content-Length: 33\r\n\r\n" .
    
            "username=mustap&comment=NOCOMMENT\r\n"
    
        )
    
    );
    
    
    
    // get the requested page from the server
    
    // with our header as a request-header
    
    
    
    $context = stream_context_create($hdrs);
    
    $fp = fopen("http://" . $host . "/vivid" . $file, 'r' , false, $context);
    
    fpassthru($fp);
    
    fclose($fp);
    
    ?>
    
    Code (markup):
    Specifically, here are lines 49-51 from the source
    
    $context = stream_context_create($hdrs);
    
    $fp = fopen("http://" . $host . "/vivid" . $file, 'r' , false, $context);
    
    Code (markup):
    Thanks in advance!
     
    Drej, Aug 1, 2007 IP
  2. themole

    themole Peon

    Messages:
    82
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Fix this line:

    
    header'=> accept-language: en\r\n" .
    
    Code (markup):
    -the mole
     
    themole, Aug 1, 2007 IP
  3. pfek

    pfek Member

    Messages:
    98
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    45
    #3
    It should be
    'header'=>...
     
    pfek, Aug 1, 2007 IP
  4. Drej

    Drej Peon

    Messages:
    79
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Could one of you provide me with your MSN, AIM, Y! or iCQ? This script seems to have more problems, and I really need it fixed. I'm willing to give you guys $5 over PP. Thanks
     
    Drej, Aug 2, 2007 IP
  5. Drej

    Drej Peon

    Messages:
    79
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    User 'Vangs' has been helping me a lot over IM, thanks a lot
     
    Drej, Aug 2, 2007 IP
  6. exodus

    exodus Well-Known Member

    Messages:
    1,900
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    165
    #6
    Is it me or does anyone else not find the comments NOT funny? Attacking websites is not something I would want to give someone that doesn't know what they are doing help with! They normally call them script kiddies! :mad:
     
    exodus, Aug 2, 2007 IP