Jump to content

submit button


dhanasekar

Recommended Posts

hi... i am very new to php.... i need to create new password generation in php, i have created password new generation with great struggle.. when i click on load button ... it fetches all the data what in needed... for ex password:123112 , when i click on generate password button...a new password should replace on my oid password for ex password:ADADA... <?php if(!isset($_POST['gpass'])) { $newcode_length=0;$newcode=0;$codelenght = 8;while($newcode_length < $codelenght) {$x=1;$y=3;$part = rand($x,$y);if($part==1){$a=49;$b=57;} // Numbersif($part==2){$a=65;$b=90;} // UpperCaseif($part==3){$a=97;$b=122;} // LowerCase$code_part=chr(rand($a,$B));$newcode_length = $newcode_length + 1;$newcode = $newcode.$code_part;}} ?> have wrote sum thing like this ...but generate password button didnt work..pl help some one...thanks in advance

Link to comment
Share on other sites

There are examples of update statements here: http://www.w3schools.com/sql/sql_update.asp I'm not sure how your application accesses the database, so you'll need to figure that out first. Once you know that then you can use the $newcode variable to update the password in the database as long as you have the ID of the user to update. That ID may have been passed through the form or it may be stored in the session or somewhere else.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...