OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
From: php-general-digest-helplists.php.net
Date: Fri Oct 12 2001 - 23:21:44 CDT

  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

    php-general Digest 13 Oct 2001 04:21:44 -0000 Issue 931

    Topics (messages 70925 through 70959):

    Re: Export/Import data from local PC MySQL database to remote ISP MySQL database.
            70925 by: Andrew Hill

    Loading elements into an array dynamically
            70926 by: Nigel Pauli
            70928 by: Intruder
            70932 by: Nigel Pauli

    Re: Austin - Lost Child, please look & forward
            70927 by: Dallas K.

    Users changing passwords
            70929 by: King, Justin
            70948 by: J Smith

    4.06 CGI IIS - MAIL abnormalities
            70930 by: Matthew Luchak
            70951 by: Yasuo Ohgaki

    Re: --enable-trans-sid and HTML 4.01 compliance
            70931 by: Jon Haworth
            70954 by: Yasuo Ohgaki

    Checkboxes
            70933 by: Intruder
            70940 by: Pavel Jartsev

    php_mcrypt.dll
            70934 by: Brian Gleason

    testing an email address
            70935 by: Joseph Bannon
            70936 by: Intruder
            70937 by: Michael Geier, CDM Systems Admin
            70938 by: Intruder
            70939 by: Salty Marine
            70941 by: Pavel Jartsev
            70944 by: Marc Pozzuoli
            70946 by: Matthew Luchak
            70953 by: Yasuo Ohgaki
            70956 by: Philip Olson
            70959 by: Jason G.

    Re: Best URL of main 10-20 PHP tutorials?
            70942 by: Alex Shi

    set timeout for fread() ?
            70943 by: Arash Dejkam
            70949 by: J Smith

    Re: REPRASED: Supported platforms comparison
            70945 by: Julio Nobrega

    Time Processing (sum of two times)
            70947 by: A. R. M.
            70950 by: Jack Dempsey

    Re: Php and Python
            70952 by: Yasuo Ohgaki

    Strictest HTML Validator
            70955 by: Jon Shoberg
            70957 by: Philip Olson
            70958 by: Phil Glatz

    Administrivia:

    To subscribe to the digest, e-mail:
            php-general-digest-subscribelists.php.net

    To unsubscribe from the digest, e-mail:
            php-general-digest-unsubscribelists.php.net

    To post to the list, e-mail:
            php-generallists.php.net

    ----------------------------------------------------------------------

    attached mail follows:


    You can use mysqldump to create a SQL file that can be run to recreate the
    state of your db on the remote machine.

    Best regards,
    Andrew Hill
    Director of Technology Evangelism
    OpenLink Software http://www.openlinksw.com
    Universal Data Access & Data Integration Technology Providers

    > -----Original Message-----
    > From: Tome [mailto:tomeaol.com]
    > Sent: Wednesday, October 10, 2001 5:08 PM
    > To: php-generallists.php.net
    > Subject: [PHP] Export/Import data from local PC MySQL database to remote
    > ISP MySQL database.
    >
    >
    > Hi:)
    > I am new to OpenSource and programming.
    >
    > How can I get data from my local PC MySQL database (or MSAccess) to the
    > remote ISP MySQL database?There must be a simple method for this :-)
    >
    > I have been an NT administrator, and made the jump to OpenSource. Some of
    > the simple things to do in SQLServer seem complicated using MySQL.
    >
    > I set up phpAdmin 2.2.0 on my remote ISP's UNIX box: I am able to browse
    > the phpAdmin 2.2.0 Welcome page, and have protected the folder with
    > .htaccess.
    >
    > I remotely created a table in the database which mimics the table
    > I have on
    > my local Windows2000 PC. Locally, the table and data had originally been
    > created in MSAccess and was exported to my local MySQL database.
    > That was a
    > menu-driven one step procedure.
    >
    > Now, I am trying to figure out how to get the data from my local PC MySQL
    > database (or MSAccess) to the remote ISP MySQL database. There must be a
    > simple method for this. I am new to OpenSource, so I need step-by-step
    > instructions.
    >
    > Should I give up?
    >
    >
    >
    >
    > --
    > PHP General Mailing List (http://www.php.net/)
    > To unsubscribe, e-mail: php-general-unsubscribelists.php.net
    > For additional commands, e-mail: php-general-helplists.php.net
    > To contact the list administrators, e-mail: php-list-adminlists.php.net
    >
    >
    >

    attached mail follows:


    I would be most grateful if someone could tell me where I am going
    wrong with this.

    What I am trying to do is to load a list of variables ($surfull) into
    an array ($surlist) where I will later sort them alphabetically. The
    mysql_query() works fine as does the mysql_num_rows(). I can print out
    a list of names in the $surfull form if I uncomment the 'echo $surful;'
    line - but I can't add those repeated surfulls to my array.

    ----------------------
    $sql = "SELECT hsurn, hforn FROM house WHERE hclass like '$class'";

    print "<h1>$class Form List</h1>";

    $result = mysql_query( $sql );
    $num_rows = mysql_num_rows( $result );
    $surlist = array( );
    while ( $a_row = mysql_fetch_array($result) )
            {
                    $surname = $a_row[hsurn];
                    $firstname = $a_row[hforn];
                    $surfull = $surname."=".$firstname;
                    #$surlist = array( $surfull );
                    $surlist = array_push( $surlist, $surfull );
                    #echo $surfull;
            }

    print $surlist[0];
    print "<p><I>Number in class: $num_rows</I><p>\n";
    -------------

    What I am expecting to happen in the while section is for another
    element to be added to the array $surlist on each pass through the rows
    of the query result by the array_push() function. What I get instead is
    this warning...

    Warning: First argument to array_push() needs to be an array in
    /var/www/info/formlist/formlist.php on line 36

    ...printed out $num_rows times which suggests that my $surlist =
    array(); line isn't creating an array as I hoped it would. I'm afraid
    my own searching through manuals and archives over the last few days
    hasn't got me anywhere and so I'd be grateful for any advice people
    might be able to give me.

    Thanks,
    Nigel

    -- 
    Nigel Pauli - I.T. Manager
    St. John's School, Northwood, U.K.
    http://www.st-johns.org.uk/
    

    attached mail follows:


    You don't need "$surlist =" try to leave just array_push( $surlist, $surfull );

    attached mail follows:


    On Friday 12 October 2001 15:16, Intruder wrote: > You don't need "$surlist =" > try to leave just > array_push( $surlist, $surfull );

    Thanks, intruder, that worked beautifully!

    Nigel

    -- 
    Nigel Pauli - I.T. Manager
    St. John's School, Northwood, U.K.
    http://www.st-johns.org.uk/
    

    attached mail follows:


    http://www.glowinglizard.com/image001.jpg

    ----- Original Message ----- From: "Mark Webley" <markwebleycity.co.uk> To: "Dallas K." <dallaskaustin.rr.com> Sent: Friday, October 12, 2001 4:10 AM Subject: Re: [PHP] Austin - Lost Child, please look & forward

    > where is the picture? > > send this email too the daily mail, and the Mirror Group of newspapers. > > ----- Original Message ----- > From: "Dallas K." <dallaskaustin.rr.com> > To: "Steve Walker" <swalkersell-a-biz.com>; "Shaun Waite" > <mwaitehotmail.com>; "Russ" <bhedanabhedana.com>; "Robert J Sherman" > <webmastersnr-graphics.com>; <php-generallists.php.net>; "John Work" > <Johnmetadot.com>; "Gene Ballard" <geneincreasenet.com>; "Eric Williams" > <Ericaustex.com>; "Amy at Work" <amyaggie01yahoo.com> > Sent: Friday, October 12, 2001 8:58 AM > Subject: [PHP] Austin - Lost Child, please look & forward > > > > This is a friend of my mothers.... Please send this along. > > Thank you. > > > > > > > > > > > > > > Please forward > > > > > > > > > > > > > > > > This girl is missing FROM Austin. Please circulate. > > > > PLEASE LOOK AT PICTURE THEN FORWARD > > > > I am asking you all, begging you to please, forward this email on to > > > > anyone and everyone you know, PLEASE. My 9 year old girl, Penny > Brown, > > > > is missing. She has been missing for now two weeks. It is still not > too > > > > late, Please help us. If anyone anywhere knows anything, sees > > > > anything, please contact me at zicozicozicohotmail.com > > > > <mailto:zicozicozicohotmail.com> > > > > I am including a picture of her. All prayers are appreciated!! It only > > > > takes > > > > 2 seconds to forward this on, if it was your child, you would want all > > the > > > > help you could get. Please. Thank you for your kindness, hopefully > you > > > > can > > > > help us. > > > > > > > > Carol R. Carreon > > > > Graduate Coordinator > > > > Graduate School of Library and Information Science > > > > University of Texas at Austin > > > > Austin, TX 78712-1276 > > > > Phone: 512/471-2416 > > > > 1/800-551-0294 > > > > Fax: 512/471-3971 > > > > e-mail: carreongslis.utexas.edu <mailto:carreongslis.utexas.edu> > > > > <mailto:carreongslis.utexas.edu <mailto:carreongslis.utexas.edu> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------------

    --
    > ----
    >
    >
    > > --
    > > PHP General Mailing List (http://www.php.net/)
    > > To unsubscribe, e-mail: php-general-unsubscribelists.php.net
    > > For additional commands, e-mail: php-general-helplists.php.net
    > > To contact the list administrators, e-mail: php-list-adminlists.php.net
    >
    

    attached mail follows:


    I'm looking at setting up a way where a user can change their password. Short of writing a script which telnets in and changes the password all in php, I can't come up with anything. Anyone have an idea on how I can go about writing a script to let a user change their password remotely without giving them a shell account? -Justin

    attached mail follows:


    Justin King wrote:

    > I'm looking at setting up a way where a user can change their password. > Short of writing a script which telnets in and changes the password all > in php, I can't come up with anything. Anyone have an idea on how I can > go about writing a script to let a user change their password remotely > without giving them a shell account? > > -Justin

    Try looking at

    http://www.php.net/manual/en/ref.exec.php

    exec(), passthru(), system() and the backtick operators let you execute external programs and commands and such through PHP.

    Be very careful with these functions, though -- make sure you validate user input rigorously. You don't want to be using code like

    exec("rm $blah");

    and have the user enter

    "/etc/passwd && perl -e \"while(1) { fork(); }\""

    or something for $blah on you.

    J

    attached mail follows:


    A script that formats and sends out an email using http vars fails with certain email addresses.

    I couldn't believe it when I saw this (not) happening. Using:

    MAIL( "$recip", "$subject", "$message", "$header" );

    where $header="From: $email_required"; is passed from an HTML form, fails to mail with certain email addresses in the $email_required var. The same script in 4.04pl2 does not fail with the same addresses.

    Again, just to make this clear - this is an intermittent problem - I can send out 2000 emails and one of them will just not mail even though it is a perfectly valid email address.

    Any thoughts on this?

    ____________________________ Matthew Luchak Webmaster Kaydara Inc. mluchakkaydara.com

    attached mail follows:


    SMTP code in PHP is not good enough. It needs to be rewritten. For the time being, you need to use SMTP implemented by PHP script or use sendmail compatible MTA on Windows. (You may need to rebuild PHP under Windows to use MTA. I use PHP under Linux.)

    Yasuo Ohgaki

    Matthew Luchak wrote: > > A script that formats and sends out an email using http vars fails with > certain email addresses. > > I couldn't believe it when I saw this (not) happening. Using: > > MAIL( > "$recip", > "$subject", > "$message", > "$header" > ); > > where $header="From: $email_required"; is passed from an HTML form, > fails to mail with certain email addresses in the $email_required var. > The same script in 4.04pl2 does not fail with the same addresses. > > Again, just to make this clear - this is an intermittent problem - I can > send out 2000 emails and one of them will just not mail even though it > is a perfectly valid email address. > > Any thoughts on this? > > ____________________________ > Matthew Luchak > Webmaster > Kaydara Inc. > mluchakkaydara.com >

    attached mail follows:


    Have a look in your php.ini file, under the "Data Handling" section. You should find a line

    ;arg_separator.output = "&amp;"

    uncomment this line and all should be well

    Cheers Jon

    -----Original Message----- From: Matthew Leingang [mailto:leingangmath.rutgers.edu] Sent: 12 October 2001 13:36 To: php-generallists.php.net Subject: [PHP] --enable-trans-sid and HTML 4.01 compliance

    Hi,

    I am interested in making my PHP pages HTML 4.01 transitional compliant. One of the conditions for this is that all ampersands in the document be the beginning of entity references. This includes those embedded in the query strings of links:

    BAD http://www.php.net/?foo=bar&bar=baz GOOD http://www.php.net/?foo=bar&bar=baz

    My problem is that I am using sessions and would like to keep the functionality of --enable-trans-sid. This adds the session name and ID to certain URLs in the page. But it does it with '&' in the non-HTML4 way.

    There doesn't seem to be a way to change the separating character that PHP uses to append session name and ID to the url, either by configure directive, .htaccess, or on-the-fly. Or is there? What other ways can I get around this? I tried output buffering the whole page and fixing the naked ampersands with a regexp, but it seems like the url adapting is done between the true end of the script and the output to the browser.

    Another solution: turn trans-sid off and roll my own, output buffering and adding session name and ID to all important urls manually, using the "right" sepchar. This seems redundant and slow.

    Anyone tried to get around this before? I found some PHP sites that boasted HTML 4.01 compliance, but when I ran them through validator.w3.org they had the same problem I did.

    Or is it that older browsers don't understand &amp; in the url, and PHP wants maximum compatibility rather than maximum compliance?

    Rock on, Matt

    ********************************************************************** 'The information included in this Email is of a confidential nature and is intended only for the addressee. If you are not the intended addressee, any disclosure, copying or distribution by you is prohibited and may be unlawful. Disclosure to any party other than the addressee, whether inadvertent or otherwise is not intended to waive privilege or confidentiality'

    **********************************************************************

    attached mail follows:


    There is a option for arg separator for recent PHP. Look for php.ini

    (This is from 4.0.8-dev php.ini-recommend) ; The separator used in PHP generated URLs to separate arguments. ; Default is "&". ;arg_separator.output = "&amp;

    Default is & for compatibility for older versions.

    Yasuo Ohgaki

    Matthew Leingang wrote: > Hi, > > I am interested in making my PHP pages HTML 4.01 transitional compliant. > One of the conditions for this is that all ampersands in the document be > the beginning of entity references. This includes those embedded in the > query strings of links: > > BAD http://www.php.net/?foo=bar&bar=baz > GOOD http://www.php.net/?foo=bar&bar=baz >

    attached mail follows:


    Hi All,

    I have a question concerning checkboxes on the FORM.

    As example: 1) <form name="form1" method="POST" action="<?php echo $PHP_SELF ?>"> <?php // This code reads some lines from db table and writes checkbox and about field // content directly after it. $sql= "SELECT id, about, active .... FROM table WHERE some_field='$some_value'"; $res= mysql_query($sql); if (mysql_num_rows($res)>0) { while ($row=mysql_fetch_array($res)) { if ($row["active"]==1) { $box="CHECKED"; } else { $box=""; }; printf('<input type="checkbox" name="active%s" %s>',$row["id"],$box); echo $row["about"]; }; }; ?> <input type="submit" name="sub1" value="UPDATE BUTTON!"> </form>

    It produces something like this on the requested page: |v| Some about 1 | | Some about 2 |v| Some about 3 | | Some about 4 |v| Some about 5 |v| Some about 6 |v| Some about 7

    |UPDATE BUTTON!|

    The code one can use to handle this: <?php if ($sub1) { reset ($HTTP_POST_VARS); // Set active field to "0"(FALSE) for ALL the records satisfying WHERE clause $sql="UPDATE table SET active=0 WHERE some_field='$some_value'"; mysql_query($sql); while (list ($name, $val)=each($HTTP_POST_VARS)) { if (substr($name,0,6)="active") { $id=substr($name,0,6); $sql="UPDATE table SET active=1 WHERE some_field='$some_value' AND id='$id'"; mysql_query($sql); }; }; }; ?>

    2)

    <form name="form1" method="POST" action="<?php echo $PHP_SELF ?>"> <?php // This code produces the same visual HTML output, but it slightly differs // from the previous one $sql="SELECT id, about, active .... FROM table WHERE some_field='$some_value'"; $res=mysql_query($sql); if (mysql_num_rows($res)>0) { while ($row=mysql_fetch_array($res)) { if ($row["active"]==1) { $box="CHECKED"; } else { $box=""; }; printf('<input type="hidden" name="new%s" value="active%s">',$row["id"],$row["id"]); printf('<input type="checkbox" name="active%s" %s>',$row["id"],$box); echo $row["about"]; }; }; ?> <input type="submit" name="sub1" value="UPDATE BUTTON!"> </form>

    The code one can use to handle 2nd variant: <?php if ($sub1) { reset ($HTTP_POST_VARS);

    while (list ($name, $val)=each($HTTP_POST_VARS)) { if (substr($name,0,3)="new") { if ($$val!="") { // Pay attention to this line.!!!!!!!!!!!!!! $id=substr($name,0,3); $sql="UPDATE table SET active=1 WHERE some_field='$some_value' AND id='$id'"; mysql_query($sql); }; }; }; }; ?>

    So, my questions are:

    1) are there any more variants which could be "more correct", faster, easier and better ??? Just because I don't like them both. First variant is stupid (I used it when I started with MySQL/PHP) and second produces more HTML...

    2) which variant you'd prefer to use from this two ???

    Waiting for reply! ;-)

    attached mail follows:


    Intruder wrote: > > ... > > So, my questions are: > > 1) > are there any more variants which could be "more correct", faster, easier and > better ??? Just because I don't like them both. First variant is stupid (I used > it when I started with MySQL/PHP) and second produces more HTML... > > 2) > which variant you'd prefer to use from this two ??? > > Waiting for reply! ;-) >

    I'd prefer third variant. :)

    Generate your checkboxes this way: printf('<input type="checkbox" name="active[%s]" %s>',$row["id"],$box);

    On PHP-side you'll have $HTTP_POST_VARS['active'], which is array of values of checked checkboxes. And use just 'for'- or 'foreach'-loop to update these values into database.

    Hope this helps.

    -- 
    Pavel a.k.a. Papi
    

    attached mail follows:


    I just want to know if anyone ever found any of the below listed files so mcrypt can be used on win32 machines......

    php_mcrypt.dll

    or

    libmcrypt.lib libmcrypt.c

    With either one of the files listed in the second I should be able to compile the php_mcrypt.dll.

    TIA

    Brian "Squirre1" Gleason Mid-West Gaming League http://www.mwgl.org

    attached mail follows:


    Is there a PHP function to test whether an email address is valid or not?

    Thanks, Joseph

    attached mail follows:


    JB> Is there a PHP function to test whether an email address is valid or not? There is no such a function as for PHP4.0 ;))) But you can use this one

    function validmail($email) { if(eregi("^[a-z0-9\._-]++[a-z0-9\._-]+\.+[a-z]{2,3}$", $email)) return TRUE; else return FALSE; };

    attached mail follows:


    That only checks formatting...there is no absolute test for validity.

    The only thing you can do is send an email to the address they supply and force them to reply to it.

    -----Original Message----- From: Intruder [mailto:intrudermail.lv] Sent: Friday, October 12, 2001 11:09 AM To: Joseph Bannon Cc: PHP (E-mail) Subject: Re: [PHP] testing an email address

    JB> Is there a PHP function to test whether an email address is valid or not? There is no such a function as for PHP4.0 ;))) But you can use this one

    function validmail($email) { if(eregi("^[a-z0-9\._-]++[a-z0-9\._-]+\.+[a-z]{2,3}$", $email)) return TRUE; else return FALSE; };

    --
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, e-mail: php-general-unsubscribelists.php.net
    For additional commands, e-mail: php-general-helplists.php.net
    To contact the list administrators, e-mail: php-list-adminlists.php.net
    

    attached mail follows:


    MGCSA> That only checks formatting...there is no absolute test for validity. MGCSA> The only thing you can do is send an email to the address they supply and MGCSA> force them to reply to it.

    If there would be test for validity spammers would rule the world ;)))))

    attached mail follows:


    Greetings to You:

    I need a better email validation function. I want to make sure the email address won't return any errors.

    Regards, Salty

    -----Original Message----- From: Intruder [mailto:intrudermail.lv] Sent: Friday, October 12, 2001 12:09 PM To: Joseph Bannon Cc: PHP (E-mail) Subject: Re: [PHP] testing an email address

    JB> Is there a PHP function to test whether an email address is valid or not? There is no such a function as for PHP4.0 ;))) But you can use this one

    function validmail($email) { if(eregi("^[a-z0-9\._-]++[a-z0-9\._-]+\.+[a-z]{2,3}$", $email)) return TRUE; else return FALSE; };

    --
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, e-mail: php-general-unsubscribelists.php.net
    For additional commands, e-mail: php-general-helplists.php.net
    To contact the list administrators, e-mail: php-list-adminlists.php.net
    

    _________________________________________________________ Do You Yahoo!? Get your free yahoo.com address at http://mail.yahoo.com

    attached mail follows:


    Salty Marine wrote: > > Greetings to You: > > I need a better email validation function. I want to make sure the email > address won't return any errors. >

    Some additional validation is possible to do with these functions: http://www.php.net/manual/en/function.checkdnsrr.php http://www.php.net/manual/en/function.getmxrr.php

    -- 
    Pavel a.k.a. Papi
    

    attached mail follows:


    This post made me wonder. Is it possible to test the domain of the email to see if it is a valid domain? This could help with typos on the users part.

    Thanks,

    P

    -----Original Message----- From: Salty Marine [mailto:saltymarineyahoo.com] Sent: Friday, October 12, 2001 9:27 AM To: php-generallists.php.net Subject: RE: [PHP] testing an email address

    Greetings to You:

    I need a better email validation function. I want to make sure the email address won't return any errors.

    Regards, Salty

    -----Original Message----- From: Intruder [mailto:intrudermail.lv] Sent: Friday, October 12, 2001 12:09 PM To: Joseph Bannon Cc: PHP (E-mail) Subject: Re: [PHP] testing an email address

    JB> Is there a PHP function to test whether an email address is valid or not? There is no such a function as for PHP4.0 ;))) But you can use this one

    function validmail($email) { if(eregi("^[a-z0-9\._-]++[a-z0-9\._-]+\.+[a-z]{2,3}$", $email)) return TRUE; else return FALSE; };

    --
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, e-mail: php-general-unsubscribelists.php.net
    For additional commands, e-mail: php-general-helplists.php.net
    To contact the list administrators, e-mail: php-list-adminlists.php.net
    

    _________________________________________________________ Do You Yahoo!? Get your free yahoo.com address at http://mail.yahoo.com

    -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-helplists.php.net To contact the list administrators, e-mail: php-list-adminlists.php.net

    attached mail follows:


    From the docs....

    getmxrr ssmithpersonalcarehmo.com 27-Oct-2000 05:05 A common use of this function is to check the validity of an email address. Through trial and error, I have found that this works fairly well, although it does not check for the existence of the actual user; rather, it verifies the existence of any and all domains associated with the address.

    function email_is_valid ($email) { if (eregi("^[0-9a-z]([-_.]?[0-9a-z])*[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,3} $", $email, $check)) { if ( getmxrr(substr(strstr($check[0], ''), 1), $validate_email_temp) ) { return TRUE; } // THIS WILL CATCH DNSs THAT ARE NOT MX. if(checkdnsrr(substr(strstr($check[0], ''), 1),"ANY")){ return TRUE; } } return FALSE; } ____________________________ Matthew Luchak Webmaster Kaydara Inc. mluchakkaydara.com

    -----Original Message----- From: Marc Pozzuoli [mailto:pXRentDVD.com] Sent: Friday, October 12, 2001 2:33 PM To: php-generallists.php.net Subject: RE: [PHP] testing an email address

    This post made me wonder. Is it possible to test the domain of the email to see if it is a valid domain? This could help with typos on the users part.

    Thanks,

    P

    attached mail follows:


    Joseph Bannon wrote: > Is there a PHP function to test whether an email address is valid or not? > > Thanks, > Joseph

    There are many implementations and it's not hard to write them by yourself. (check format, check DNS MX, connect to MTA and check user is valid. There are cases that user check will not work, though)

    Look through this page, you'll find how to do that.

    http://www.zend.com/codex.php?CID=11

    --
    Yasuo Ohgaki
    

    attached mail follows:


    On Fri, 12 Oct 2001, Michael Geier, CDM Systems Admin wrote:

    > That only checks formatting...there is no absolute test for validity. > > The only thing you can do is send an email to the address they supply and > force them to reply to it.

    I strongly agree with this point. You can make sure an email address has correct syntax, which is good, but entering a "real" email address is trivial. Using functions like getmxrr() is fine but what does it prove? Not much.

    Consider emailing the user and make them respond to your request. A common way is to provide a temporary "id". So, they'd be given an url in the email, something like :

    http://www.example.com/check.php?id=3kk39FH8Fbb3F3338Hf8h3F8f8jf5k35

    Once confirmed as their assigned unique temporary "id" (someone goes to above url and it checks out okay), it's seen as valid/confirmed. It's not uncommon to set a time limit for their response either.

    Regards, Philip Olson

    > > -----Original Message----- > From: Intruder [mailto:intrudermail.lv] > Sent: Friday, October 12, 2001 11:09 AM > To: Joseph Bannon > Cc: PHP (E-mail) > Subject: Re: [PHP] testing an email address > > > JB> Is there a PHP function to test whether an email address is valid or > not? > There is no such a function as for PHP4.0 ;))) > But you can use this one > > > function validmail($email) { > if(eregi("^[a-z0-9\._-]++[a-z0-9\._-]+\.+[a-z]{2,3}$", $email)) return > TRUE; > else return FALSE; > }; > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    Here, This not only checks the form of an email address, but if the domain is valid!

    //This function checks the validity of an email, and if the domain is registered! //If the second parameter is true, then it does NOT check for a valid domain name.

    function check_email($email, $bJustFormat = FALSE) { if (eregi("^[0-9a-z]([-_.]?[0-9a-z])*[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,3}$", $email, $check)) if ($bJustFormat || getmxrr(substr(strstr($check[0], ''), 1), $validate_email_temp)) return TRUE; return FALSE; }

    At 11:06 AM 10/12/2001 -0500, Joseph Bannon wrote: >Is there a PHP function to test whether an email address is valid or not? > >Thanks, >Joseph > > > > > > > > > > > > > > > > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: php-general-unsubscribelists.php.net >For additional commands, e-mail: php-general-helplists.php.net >To contact the list administrators, e-mail: php-list-adminlists.php.net

    attached mail follows:


    For PHP basics, I think www.php.net, www.phpbuilder.net and www.zend.com can provide most of your needs. I also suggest you download a PHP manual and install it on your computer. For MySQL access in php, I strongly suggest this site: http://www.vtwebwizard.com/tutorials/mysql/index.php . For SQL basics, any book about SQLcan teach you basic knowledge and won't be different with MySQL basics.

    Alex

    ----- Original Message ----- From: "Marcus James Christian" <marcusmjchristianunlimited.com> To: <php-generallists.php.net> Sent: Thursday, October 11, 2001 11:16 PM Subject: [PHP] Best URL of main 10-20 PHP tutorials?

    > Hello, > > I just dl's the hefty manual and it's way overkill for the knowledge I > need on hand about PHP. > > I've searched the main site but without knowing the function names that > route makes little sense. > > So I was wondering if anybody knows of a site or best sites that house > some neatly organized basic 10 - 20 ish main tutorials on PHP. > > i.e. > > 1 about strings > 1 about vars, > 1 about basic MySQL > etc > > Just coverage of the main basic "everybody will use" PHP stuff. > > Thanks, > Marcus > > -- > Marcus James Christian UNLIMITED > Multimedia Internet Design > http://mjchristianunlimited.com > > Proudly presents the music of CHROMATICUS > at http://www.mp3.com/chromaticus > and http://chromaticus.com > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net > >

    attached mail follows:


    Hi,

    how can I set timeout for fread() ?

    I have some code like this : if ( $f = fopen( "http://$domain/$file" , "r" ) ) $i=fread($f,5000);

    for some specific $domains which the server can't read from because of network problems the script hangs because fread() doesn't have any timeout and the script waits to receive data forever !

    help me please.

    Arash

    attached mail follows:


    You could try looking at the sockets extension, specifically at socket_select(). Be careful, though, as PHP's socket_select() has a bit of a bug that's being fixed where you can't set the timeout to NULL as you can in the standard system select() call. This will likely be fixed soon.

    Also take note that the sockets extension is marked "experimental".

    J

    Arash Dejkam wrote:

    > Hi, > > how can I set timeout for fread() ? > > I have some code like this : > if ( $f = fopen( "http://$domain/$file" , "r" ) ) > $i=fread($f,5000); > > for some specific $domains which the server can't read from because of > network problems the script hangs because fread() doesn't have any timeout > and the script waits to receive data forever ! > > help me please. > > Arash

    attached mail follows:


    Yes, I couldn't resist myself too

    :-D

    --
    

    Julio Nobrega.

    Um dia eu chego lá: http://sourceforge.net/projects/toca

    "Marco Fioretti" <m.fiorettiinwind.it> wrote in message news:GL309X$Ir67rAV1iWyDGmTPs2vxqu9Jitnh7WxjLuaDDQ8VE2Cbr_inwind.it... > From netcraft.com: > > Microsoft Windows has a significantly higher share of the web when one > counts by computer, rather than by host, as in the conventional Web Server > Survey. ..... > Windows is most popular with end-user and > self hosted sites, where the host to computer ratio is much smaller. >

    or, in other words, windows is so inefficient that the Net as it is today would require much less hosts, i.e. cost much less, if it disappeared, right?

    Sorry, I know perfectly that this is on the flaming side and has nothing to do with my own original message, but the hunch was too good to give it up...

    Ciao,

    Marco Fioretti postingcouldn't resist

    attached mail follows:


    Hi,

    Does anybody know of a way in PHP to get the sum of two times? For example, you have extracted "11:05:00" from one field of a database, and "00:56:00" from another field. I need to add the two and come up with something like: "11:05:00" + "00:56:00" = "12:01:00"

    In other words, the sum of two times (as in a time field).

    It could be used, for instance, when you're trying to add an appointment time and the length of the appointment to get the end of that appointment time, or the start of the next appointment time.

    Some scripting languages have functions like SumTimes(time1, time2) OR SumDates(date1, date2) OR DiffTimes(time1, time2)

    Any ideas how to accomplish this in PHP please? Thanks.

    attached mail follows:


    convert the times to seconds, add the seconds, reconvert into a time checkout http://php.net/date and http://php.net/mktime

    jack

    "A. R. M." wrote:

    > Hi, > > Does anybody know of a way in PHP to get the sum of two times? > For example, you have extracted "11:05:00" from one field of a > database, and "00:56:00" from another field. > I need to add the two and come up with something like: > "11:05:00" + "00:56:00" = "12:01:00" > > In other words, the sum of two times (as in a time field). > > It could be used, for instance, when you're trying to add an > appointment time and the length of the appointment to get the > end of that appointment time, or the start of the next appointment time. > > Some scripting languages have functions like > SumTimes(time1, time2) OR SumDates(date1, date2) > OR DiffTimes(time1, time2) > > Any ideas how to accomplish this in PHP please? > Thanks. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net

    attached mail follows:


    I'm not sure what you really want to do. Anyway, try something like

    system("some_command > /dev/null 2>&1 &");

    BTW, is your python script ok? (Make sure it returns to shell)

    Yasuo Ohgaki

    Mihailo Dzigurski wrote: > Hello, > > I have problem with executing python script from php. Python script is > executed with system function from php and after that browser is locked out. > When I restart IE everything is ok. This happens every time. > > Code fragment: > system($python_path . " " . $install_path . "/monitor.py &"); > > Is there any better solution for this? > > Thanks, > Misa. > > > _________________________________________________________ > Do You Yahoo!? > Get your free yahoo.com address at http://mail.yahoo.com > >

    attached mail follows:


    What is the strictest HTML validator down to the very end of the specification ? Also something that can point out browser specific issues.

    THanks

    attached mail follows:


    Try :

    http://validator.w3.org/

    Regards, Philip

    On Fri, 12 Oct 2001, Jon Shoberg wrote:

    > > What is the strictest HTML validator down to the very end of the > specification ? Also something that can point out browser specific issues. > > THanks > > >

    attached mail follows:


    >What is the strictest HTML validator down to the very end of the >specification ? Also something that can point out browser specific issues.

    I like CSE:

    www.htmlvalidator.com

    It is very good and very configurable. It isn't the absolutely strictest in an academic sense, but works very well for compatibility problems in the real world.