Retrieving POST data from php://input

    Date: 11/25/07 (PHP Community)    Keywords: php

    Howdy,

    I have wrote this script:

        $max = $_SERVER[‘CONTENT_LENGTH’];
    
        $fp = fopen(“php://input”, “rb”);
    
            for($i=0; $i<$max; $i++) {
                $ch = fread($fp, 1);
                echo $ch;
                flush();
                ob_flush();
                sleep(1);
            }
    
        fclose($fp);
    


    It’s working right.

    But I’m interesting in this: how script retrieving data from php://input? Does it get data directly from browser? Or does PHP retrieve it by itself and later send data to script?

    Source: http://community.livejournal.com/php/598419.html

« database and check boxes || RegEx filtering for comment... »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home