Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Reading from stdin problem.
Old 11-21-2007, 07:52 PM Reading from stdin problem.
Junior Talker

Posts: 3
Trades: 0
Hi!

I setup an email (redirect@domain.com) that all messages received will be redirected to my script for management, its kind of a management of bounced emails then I used the following code to get the email:

// Read
$fd = fopen("php://stdin", "r");
$email = "";

while (!feof($fd)) {
$email .= fread($fd, 1024);
}
fclose($fd);


and I store the $email to the database. When I tried to directly send a message to (redirect@domain.com), it works as expected but when I purposely send a message to an invalid email with the return path is (redirect@domain.com) it didn't store the $email to my database. What went wrong with my code? Please help.
jeboy25 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-21-2007, 08:31 PM Re: Reading from stdin problem.
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Try already to log the connection made to your script.
Maybe the mailing redirection don't work, and as you work totally blind here, you will need it.
The error_log() function is what you can use, but set the destination log file first, with an ini_set();

Try to set an error_reporting to E_ALL, to see every warning, notices or else in your log.

PHP Code:
ini_set('log_file','php.log');
ini_set('display_errors',false);
ini_set('log_errors',true);
ini_set('display_errors',false);
error_reporting(E_ALL); 
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Reply     « Reply to Reading from stdin problem.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.10120 seconds with 12 queries