[PHP] parsing mail files
Hello! I am looking for some sample code that will parse a file in Unix mbox format. I want to write an app that will examine mail messages for email-registration info. Parsing the mail with the registration is what I will do, but Im hoping someone has already done some relatively simple code that will return the next mail message from the file. I've checked phpbuilder.com but I have only found one thread about this and that thread pretty much says read the RFC's, write RegExps. I don't have a problem with doing that, it's just that if someone has already done it and is willing to offer up their work, it would save me the trouble of doing it myself. Thanks! -Michael -- In light of the terrorist attack on the U.S.: They that give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety. -- Benjamin Franklin, 1759 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] parsing mail files
On Mon, Apr 29, 2002 at 02:42:01PM +0200, Michal Dvoracek wrote: try sourceforge.net or freshmeat.net. There are very usefull programs. Try search: mail mime Great suggestion, thanks! -- In light of the terrorist attack on the U.S.: They that give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety. -- Benjamin Franklin, 1759 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] is_int() and is_double
I am having trouble with the is_int() and is_double() functions. The relevant parts of the function I'm using are: --- function lookupProduct( $partNum, $serial ) { print( lookupProduct( $partNum, $serial )BR\n ); print( CENTER\n ); printf( \$partNum: %d does %sappear to be a number, and %sa doubleBR\n, $partNum, ( is_numeric( $partNum ) ? : not ), ( is_double( $partNum ) ? : not ) ); printf( \$serial: %d does %sappear to be a number, and %sa doubleBR\n, $serial, ( is_numeric( $serial ) ? : not ), ( is_double( $serial ) ? : not ) ); } --- The function is called after a form submission from HTML. When I enter 12 14 I get: --- lookupProduct( 12, 14 ) $partNum: 12 does appear to be a number, and not a double $serial: 14 does appear to be a number, and not a double --- When I enter 12.514.8 I get: --- lookupProduct( 12.5, 14.8 ) $partNum: 12 does appear to be a number, and not a double $serial: 14 does appear to be a number, and not a double --- Why is the function is_double() failing? I have an analagous problem with the is_int() function. Thanks! -Michael -- In light of the terrorist attack on the U.S.: They that give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety. -- Benjamin Franklin, 1759 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] MySQL query help
On Mon, Sep 10, 2001 at 03:59:36PM -0500, Sheridan Saint-Michel wrote: Well, I played with this a little more and it seems to be acting oddly when you first call this select unless you set the variable first. So if the below doesn't work try actually doing this $query=set @count=NULL; select tableName.*,if(@count,@count:=@count+1,@count:=1) as inc, from tableName; (I also realized that simply having @count as the test value should work as it should default to NULL) If I don't set it, it just returns 1 on every row. Anyone know why it is doing this? (I am Running MySQL 3.23.36) Thank you very much for your help. I tried this (well, from the command line, but I'm sure from within PHP it'll work just fine, too) and it does just what I want! I looked in my MySQL book and I found the information on the if() operator/function. However, there was no mention in the text about using variables with the @ prefix... Oops, here it is in the online manual that installed with mysql 3.23.36... I should have looked there first. Thanks for your help! -Michael -- No, my friend, the way to have good and safe government, is not to trust it all to one, but to divide it among the many, distributing to every one exactly the functions he is competent to. It is by dividing and subdividing these republics from the national one down through all its subordinations, until it ends in the administration of every man's farm by himself; by placing under every one what his own eye may superintend, that all will be done for the best. -- Thomas Jefferson, to Joseph Cabell, 1816 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] MySQL query help
I'm trying to make a query that will number it's own output rows. e.g. when listing all the entries in a table that are related to a specific invoice, there will be a column with a monotonically increasing integer value (1-x where x is the number of matching entries). I know I can easily do this with PHP after the query is generated, but I have a generic function to create a pulldown menu selection that will work easily if I can just get that counter column in there... I've tried: select tableName.*, 1 as inc, sum( inc ) from tableName; But sum() will only accept a table column, not a display column... I have the Widenius MySQL book, but I haven't found anything useful in there. If anyone has an idea, I'd appreciate it... -Michael -- No, my friend, the way to have good and safe government, is not to trust it all to one, but to divide it among the many, distributing to every one exactly the functions he is competent to. It is by dividing and subdividing these republics from the national one down through all its subordinations, until it ends in the administration of every man's farm by himself; by placing under every one what his own eye may superintend, that all will be done for the best. -- Thomas Jefferson, to Joseph Cabell, 1816 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Form variables
According to the docs, when creating form variables which will be passed as globals to the next PHP script invocation, one can make single dimensional arrays, but not multi-dimensional arrays. I read this after I'd created a script which generates a form with a 2D array on it. But as I test it, it seems to work. Now, I'm perfectly happy that it works, but should I be concerned about how it works? Is this something which may only work in Navigator and nothing else? In short, it the 1D array a limitation of HTML or PHP? If it's a risky structure to use, I'll find a way to work it into a single dimensional array... Thanks! -Michael -- No, my friend, the way to have good and safe government, is not to trust it all to one, but to divide it among the many, distributing to every one exactly the functions he is competent to. It is by dividing and subdividing these republics from the national one down through all its subordinations, until it ends in the administration of every man's farm by himself; by placing under every one what his own eye may superintend, that all will be done for the best. -- Thomas Jefferson, to Joseph Cabell, 1816 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] enum and set possible values
I'm looking here at the mysql functions for PHP4.0.4 and I'm not finding what I seek... I see that mysql_fetch_field() will get information about a field in the result set from a mysql_db_query(). What I'm wanting to find out is what the possible values are for an enum or a set. So if I have an enum with possible values "Yes" and "No" or a set with possible values "Single", "Married", "Divorced", "Widowed", I seek a function that will return an array of strings containing those possible values. Does such a function exist? I suppose if not it would be possible to write one from the output of a "show columns from X" query... Thanks! -Michael -- No, my friend, the way to have good and safe government, is not to trust it all to one, but to divide it among the many, distributing to every one exactly the functions he is competent to. It is by dividing and subdividing these republics from the national one down through all its subordinations, until it ends in the administration of every man's farm by himself; by placing under every one what his own eye may superintend, that all will be done for the best. -- Thomas Jefferson, to Joseph Cabell, 1816 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] update two frames at once?
Hello al! Is it possible to have two frames updated when cliking on one link? I have a page that is broken into 4 parts: master title section title d section screen i r . what I want is that when a link is clicked on in the directory (the left column), I'd like to update the section title *and* the section screen... It seemed a cool layout at the time, but I'm thinking this isn't easily possible and I might just have to incorporate a section title on the section screen... But before I rewrite it, I thought I'd ask here. Thanks! -Michael P.S. I'd like to commend the regular posters to this list on being SOOO informative and patient! Every small question to this list always gets several useful answers, even when I've seen questions asked over and again. -- No, my friend, the way to have good and safe government, is not to trust it all to one, but to divide it among the many, distributing to every one exactly the functions he is competent to. It is by dividing and subdividing these republics from the national one down through all its subordinations, until it ends in the administration of every man's farm by himself; by placing under every one what his own eye may superintend, that all will be done for the best. -- Thomas Jefferson, to Joseph Cabell, 1816 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] HTML book recommendation
This is a bit off-topic, but I'm curious what you PHP'ers would recommend as a good HTML book. I think I need to learn some stylesheet stuff and the tutorial I've got covers the basics, but I'd like some more in-depth info on the commands. Is the O'Reilley(sp?) book the best, or are there better out there? -Michael -- No, my friend, the way to have good and safe government, is not to trust it all to one, but to divide it among the many, distributing to every one exactly the functions he is competent to. It is by dividing and subdividing these republics from the national one down through all its subordinations, until it ends in the administration of every man's farm by himself; by placing under every one what his own eye may superintend, that all will be done for the best. -- Thomas Jefferson, to Joseph Cabell, 1816 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Ret from text input
I have a php script that I'm writing for taking/passing/reading phone messages. I've got a screen where one enters the name of the person leaving the message. I've found that when the "from_whom" field is active, if the user hits Return, the form is returned w/o hitting a "submit" button. Is this defined behavior, or is it Netscape-specific? Is there a way to turn that off? -Michael -- No, my friend, the way to have good and safe government, is not to trust it all to one, but to divide it among the many, distributing to every one exactly the functions he is competent to. It is by dividing and subdividing these republics from the national one down through all its subordinations, until it ends in the administration of every man's farm by himself; by placing under every one what his own eye may superintend, that all will be done for the best. -- Thomas Jefferson, to Joseph Cabell, 1816 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] incorrct behavior w/ persistent connection
Hello all! I'm VERY new to PHP+MySQL, but I've been writing software for years. Anyway, I have a simple question to see if anyone else has had this problem. I have a PHP app that creates a table and makes entries to it. Those entries can then be edited. I've found that if I hit the "add" button too fast (more than 1x every 2 sec or so), I will get bad results as the table is printed. The table printed shows the wrong number of rows for the table (as compared to the SELECT run from the mysql command line. Sometimes more, sometimes less. It also happens that clicking on an item to edit it might also return an empty result set from the table. I tried clearing the cache on Nutscrape, but that didn't seem to help. However, connecting to the database w/ mysql_connect() rather that mysql_pconnect() seems to have made the problem disappear. Has anyone else noticed this inconsistent persistent behavior? Red Hat Linux 7.0 Kernel 2.2.16 Apache 1.3.14 MySQL 3.23.32 PHP 4.0.4pl1 -Michael -- No, my friend, the way to have good and safe government, is not to trust it all to one, but to divide it among the many, distributing to every one exactly the functions he is competent to. It is by dividing and subdividing these republics from the national one down through all its subordinations, until it ends in the administration of every man's farm by himself; by placing under every one what his own eye may superintend, that all will be done for the best. -- Thomas Jefferson, to Joseph Cabell, 1816 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]