Reply to Re: Script to parse Paypal emails (why does it not work?)

Your name:

Reply:


Posted by Steve on 11/02/05 13:26

> I have been paying a developer to complete what I thought would be
> a relatively simple task.

To be honest I think you should resolve this with your "developer".
However, that aside... from what I can see the script can connect to a
mailbox and fetch a message body. From there onwards there seem to be
some confused assumptions. Having got a body, the script tries to
extract $plainText by fetching text between two token strings.

> function getPlainText($body){
> $a = strrev(strstr($body,"Dear ABETTERWORLD.CO.UK LTD,"));
> $b = strrev(strstr($a,"2521-swodniw=tesrahc ;lmth/txet :epyT-tnetnoC"));
> return $b;
> }

One of those tokens is the content type header "Content-type:
text/html; charset=windows-1252" - but this token will not be found in
body text fetched by the function call used:

imap_fetchbody($stream,$value->uid,1,FT_UID);

This says get the body text, specifically *excluding* headers.

So the call to getPlainText() returns an empty string, and all fails
after that.

My guess is that your "developer" has a different PHP version or IMAP
module version on his "development" server to that on your production
server. This script could be fixed by a competent developer.

---
Steve

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация