homepage Welcome to WebmasterWorld Guest from 54.145.172.149
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Reading the contents of an email that is initiating a PHP script
Reading STDIN
itledi

5+ Year Member



 
Msg#: 3764410 posted 9:54 am on Oct 13, 2008 (gmt 0)

I have an email address that initiates a php script.

I know the email initiates the script, because I have that script log it into a database.

Now, I'm trying to get the email's contents set as a variable to use in my script.

To do this I'm using STDIN, and this is my first time.

Right now I have a script that contains this line:

$fp=fopen("php://stdin","r");

The $fp variable when logged states "Resource id #6" when I'm expecting the contents of the email instead.

I've tried changing it to this (and similar varients):

$fp=fopen("php://stdin","r");
$file=fread($fp,1024);

What the $file variable logges is "". Nothing. I know that there should be something.

I can't get over this stumbeling block. Anyone have any ideas?

If it makes a difference, I'm using PAIR hosting.

 

jatar_k

WebmasterWorld Administrator jatar_k us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 3764410 posted 12:57 pm on Oct 14, 2008 (gmt 0)

hmm

the return of "Resource id #6" is correct because $fp contains only a file pointer. Whether anything is there is another story all together.

is stdin what you actually want? if so I would try other functions for reading the data.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved