RE: [PHP] PHP Email....

From: Date: Thu, 12 Jun 2003 11:55:45 +0000
Subject: RE: [PHP] PHP Email....
Groups: php.general 
Request: Send a blank email to php-general+get-151229@lists.php.net to get a copy of this message
> -----Original Message----- > From: Brian McGarvie [mailto:brian.mcgarvie@anypurposeloans.co.uk] > Sent: 12 June 2003 11:42 > > Kinda... I get it to return one line... > > The code: > > <?php > define('STDIN',fopen("php://stdin","r")); > $str = fgets(STDIN); > mail("webmaster@anypurposeloans.co.uk","Test","Test > Test...\n\nOriginal > Email:\n\n$str"); > ?> > > Emails me: > > Test Test... > > Original Email: > > >From brian.mcgarvie@anypurposeloans.co.uk Thu Jun 12 11:41:39 2003 That seems right. The description in the manual at http://uk.php.net/fgets says: "Reading ends when length - 1 bytes have been read, on a newline (which is included in the return value), or on EOF (whichever comes first)." As your fgets() call is not in a loop, you only get to the first newline as that is what comes first. Cheers! Mike --------------------------------------------------------------------- Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: m.ford@lmu.ac.uk Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

« previous php.general (#151229) next »