note 21060 added to function.fread

From: Date: Sat, 27 Apr 2002 02:08:55 +0000
Subject: note 21060 added to function.fread
Groups: php.notes 
Request: Send a blank email to php-notes+get-29901@lists.php.net to get a copy of this message
I believe PayPile, in their Instant Notification System, wants you to post a validation to them (see readfile functions page for an url to posting scripts, I think) and then read the contents of the resulting webpage to see if the transaction is valid or not. readfile doesn't help with this, unfortunately. Here's a sample script compiled from various notes above to get the contents of a webpage... <?php # Get the contents of a webpage via http lookup and display them onscreen. $filename = "http://somedomain.tld/somedirectory/somefile.html"; $fp = @fopen($filename, "r"); // use constant greater than length of expected web page $contents = fread ($fp, 999); fclose ($fp); if ($fp) { print ($contents); } else { print "It didn't work out."; } ?> HTH, Eric. -- http://www.php.net/manual/en/function.fread.php http://master.php.net/manage/user-notes.php?action=edit+21060 http://master.php.net/manage/user-notes.php?action=delete+21060 http://master.php.net/manage/user-notes.php?action=reject+21060

« previous php.notes (#29901) next »