when user submit the form need to export f开发者_JS百科orm data to text file.exporting username ,password and email from form data to text file for forgot password.
First, are you SURE you just want to write username and passwords to a file? This can be a huge security hole if you don't properly protect and encode this file. See also this stackoverflow question on how to store passwords (plus many similar questions on stackoverflow, use search box above).
That said, in it's simplest form you could just store the username plus the (encrypted) password as a line in the password file, seperated by some character that cannot occur in the username. For example, the file could look like:
adam:fsSDFf34afdfgf43
bob:Djz3fdsDF67FSjFG
In PHP5 you can use file_put_contents() instead of the standard fopen(), fwrite(), fclose() calls.
精彩评论