Differentiating between POST from an application or browser

From: Date: Fri, 09 Jun 2006 12:18:50 +0000
Subject: Differentiating between POST from an application or browser
Groups: php.general 
Request: Send a blank email to php-general+get-237678@lists.php.net to get a copy of this message
Hello, In our product, we use PHP for webservices that is inbuilt in the app. Basically, the tool calls the PHP over which is hosted over internet and communicates using XML. We send the data as raw post and in the PHP we get it as: $xmlrcvd = file_get_contents(“php://”); Now if the user accesses the page from the browser then no POST is sent and strlen($xmlrcvd) would be 0 which is correct. But file_get_contents(..) is only available from 4.3.0 and above. Calling the script below that version throws up a fatal error. I would like to check the PHP version before the above statement but would like to show different message if the file is requested by -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.8.3/359 - Release Date: 6/8/2006

« previous php.general (#237678) next »