Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    TrainReq
    Guest

    Expecting T_PAAMAYIM_NEKUDOTAYIM

    I am getting the following error:

    "Parse error: syntax error, unexpected '[', expecting T_PAAMAYIM_NEKUDOTAYIM in /home/***/public_html/p.php on line 8" , Ihave never got that error, it doesnt even look like it is in english.

    Here is my hole PHP code:

    PHP Code:
    <?
    set_time_limit
    (10 60); //this could take a while, allowing 10 minutes. just added recently see UPDATE at the top of post

    $bytes_to_send 480000 130//stream about about 2 hours of music


    //if safari is only asking for a portion of the "mp3"
    if (isset(http_get_request_headers['Range'])) {
        
    $exploded_range explode('='$http_get_request_headers['Range']);
        
    $limits explode('-'$exploded_range[1]);
        
    $length = ($limits[1] - $limits[0]) + 1//the content length
        
    $content_range 'bytes ' $limits[0] . '-' $limits[1]; //the content range

        //send fake HTTP headers to safari, telling it that we're sending only the portion of the "mp3" it asked for
        
    header('HTTP/1.1 206 Partial Content');
        
    header('Accept-Ranges: bytes');
        
    header('Content-Length: ' $length);
        
    header('Content-Range: ' $content_range '/' $bytes_to_send);
        
    header('Content-type: audio/mpeg');
    s
        
    //open the stream to the shoutcast server, set as resource $fp
        
    $fp fsockopen("www.habbohut.com""8677"$errno$errstr30) or die("Unable to connect to server!");

        
    //HTTP commands that will initiate the shoutcast server sending stream data
        
    $buf "GET / HTTP/1.0\r\nIcy-MetaData:0\r\n\r\n";

        
    //send HTTP commands in string $buf to stream $fp
        
    fwrite($fp$buf);
        
    //get next line from stream
        
    $buf fgets($fp1024);        

        
    //get next few lines and discard them, this is only
        //shoutcast data that would sound like noise if iphone played them
        
    $buf fgets($fp1024);
        
    $buf fgets($fp1024);
        
    $buf fgets($fp1024);
        
    $buf fgets($fp1024);
        
    $buf fgets($fp1024);
        
    $buf fgets($fp1024);
        
    $buf fgets($fp1024);
        
    $buf fgets($fp1024);

        
    //break if EOF
        
    if ($buf == "\r\n") {
            break;
        }

        
    $bytes_sent 0;

        
    //while pointer is not at EOF, and not too many bytes are sent...
        
    while (!feof($fp) AND ($bytes_sent $length)) {
            
    //read 1 byte of stream
            
    $buf fread($fp1);

            
    //output byte to iphone;
            
    echo $buf;
            
    $bytes_sent++;
        }
        
    fclose($fp);
        exit();
    }

    //else, it is the initial request. safari is asking for the whole "mp3", and seeing how big it is ($bytes_to_send)
    else {
        
    header('Accept-Ranges: bytes');
        
    header('Content-Length: ' $bytes_to_send);
        
    header('Content-type: audio/mpeg');

        echo 
    'blah';
        exit();
    }
    exit();
    ?>
    Line 8 is
    PHP Code:
    if (isset(http_get_request_headers['Range'])) 

  • #2
    Super Moderator JohnDubya's Avatar
    Join Date
    Nov 2006
    Location
    Missouri
    Posts
    634
    Thanks
    12
    Thanked 18 Times in 18 Posts
    If you Google this error, you'll get tons of results. Please search Google, then here, and if you still can't find anything, THEN post a message.

    Certain functions that expect variables such as isset() followed by a non-string, non-integer word will cause this error.

    (found on: http://www.michiknows.com/2006/12/28...m_nekudotayim/ )

  • #3
    Senior Coder
    Join Date
    Sep 2005
    Posts
    1,791
    Thanks
    5
    Thanked 36 Times in 35 Posts
    you're missing the $ on line 8
    My thoughts on some things: http://codemeetsmusic.com
    And my scrapbook of cool things: http://gjones.tumblr.com

  • #4
    TrainReq
    Guest
    where do i need to put the $? I dont see any variables.

  • #5
    Senior Coder
    Join Date
    Mar 2003
    Location
    Atlanta
    Posts
    1,037
    Thanks
    14
    Thanked 30 Times in 28 Posts
    Quote Originally Posted by GJay View Post
    you're missing the $ on line 8
    Quote Originally Posted by TrainReq View Post
    where do i need to put the $? I dont see any variables.
    PHP Code:
    if (isset(http_get_request_headers['Range'])) { 
    The variable inside the isset parameter.

    Edit: Disregard that, I just searched and seen that was a part of PECL.
    Most of my questions/posts are fairly straightforward and simple. I post long verbose messages in an attempt to be thorough.

  • #6
    Senior Coder
    Join Date
    Mar 2003
    Location
    Atlanta
    Posts
    1,037
    Thanks
    14
    Thanked 30 Times in 28 Posts
    What about this "s" after the headers?

    PHP Code:
        header('Content-type: audio/mpeg');

    Most of my questions/posts are fairly straightforward and simple. I post long verbose messages in an attempt to be thorough.


  •  

    Posting Permissions

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