Results 1 to 4 of 4

Thread: Sending E-mail after registration?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2009
    Posts
    21

    Sending E-mail after registration?

    Ok, well I need my PHP script to send a e-mail after someone enters there e-mail.

    Also
    Can someone help me with registration thing

    I need it to give user random password then e-mail it

  2. #2
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629

    Re: Sending E-mail after registration?

    you can send an email by using the mail function.

    you can generate a random password using the following function, taken from php.net:
    PHP Code:
    <?php
    function rand_chars($c$l$u FALSE) {
     if (!
    $u) for ($s ''$i 0$z strlen($c)-1$i $l$x rand(0,$z), $s .= $c{$x}, $i++);
     else for (
    $i 0$z strlen($c)-1$s $c{rand(0,$z)}, $i 1$i != $l$x rand(0,$z), $s .= $c{$x}, $s = ($s{$i} == $s{$i-1} ? substr($s,0,-1) : $s), $i=strlen($s));
     return 
    $s;
    }
    ?>
    string $c is the string of characters to use.
    integer $l is how long you want the string to be.
    boolean $u is whether or not a character can appear beside itself.

    Examples:
    rand_chars("ABCEDFG", 10) == GABGFFGCDA
    rand_chars("ABCEDFG", 10, TRUE) == CBGFAEDFEC

  3. #3
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    540

    Re: Sending E-mail after registration?

    That's a really useful function there kows, great find .

    Are you storing these in a database, or how are you planning on keeping the new logins?

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Apr 2009
    Posts
    21

    Re: Sending E-mail after registration?

    I am using MySQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width