Forums

PHP

This topic is locked

Send password through email

Posted 19 Jul 2001 23:43:51
1
has voted
19 Jul 2001 23:43:51 Keith Slater posted:
Im wanting to set up a form so when some one click on submit it creates a password for them and puts it into the database and then sends it to their email address. Does anyone know of any tutorials for this or what mail clients I can use I know theirs Jmail but Im on a linux sevrer and I think thats only for windows. Any help would be appreciated. What would I type to get a random assortment of letteres and number.

Thanks
Keith

Replies

Replied 20 Jul 2001 10:40:59
20 Jul 2001 10:40:59 Waldo Smeets replied:
When your linux server supports PHP and you are using UltraDev, then download PHAkt: www.interakt.ro/phakt . PHAkt is the PHP server model for UltraDev and enables you to generate PHP pages.

We have some php mail extensions in our Extensions section that might help you on your way.

Waldo Smeets - www.UDzone.com Webmaster
------------------------------------------
www.UDzone.com : A dynamic Dreamweaver,
Ultradev and Fireworks site for developers
by developers.
------------------------------------------
Replied 20 Jul 2001 11:06:09
20 Jul 2001 11:06:09 Tim Green replied:
To generate a random password using PHP you could try :-

<?php
srand((double)microtime()*1000000);
$characters = "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,0,1,2,3,4,5,6,7,8,9";
// symbols where are allowed in the password
$characters_length = (strlen($characters)-1)/2;
$token = explode(",",$characters);
$pass_length=8; // length of the password
for($i=0;$i<$pass_length;$i++) {
$rand = rand(0,$characters_length);
$password.= $token[$rand];
}

echo "$password";
?>

This snippet is courtesy of Rival7, whose code appears at www.zend.com

Hope it's of use to you.

Tim Green
Webmaster
www.rawveg.org (Coming Soon)
Replied 20 Jul 2001 16:00:23
20 Jul 2001 16:00:23 Waldo Smeets replied:
Topic moved to PHP forum.

Waldo Smeets - www.UDzone.com Webmaster
------------------------------------------
www.UDzone.com : A dynamic Dreamweaver,
Ultradev and Fireworks site for developers
by developers.
------------------------------------------

Reply to this topic