July 17, 201312 yr Newbies Hi all I hope this is not a really dumb question since I cannot find a definitive answer anywhere I am trying to create a retrieve password option from a web page. And since I am a beginner at FileMaker this is really confusing compared to how I would do this ftom php /SQL. BTW my code for adding,searching and retrieving records from PHP is working so I know I have connections to the database. Basically I would like to $newPerformScript = $fm> newPerformScriptCommand($layout_name, $script_name, $parameter); $result = $newPerformScript->execute With $parameter = to the users email address And $script_name = to the script on the fm database How do I pick the parameter in. Fm script ? How do I then search the table for this parameter ? When I match this email how do I return this users password in an email to that user ? How would I return the result of this to my php to display a success state. ? I am obviously missing something really basic about how scripts work. Kind Regards
July 17, 201312 yr First of all, storing passwords in a field is a VERY insecure method. You are much better off using FileMaker's accounts and password functions. If a user forgets a password, it is far better to create a new random one and use the Reset Account Password step, and allow the user to change it if she desires. This keeps passwords securely encrypted deep within FileMaker. If a parameter is sent to a script, one of the first steps in the script should be Set Variable[$param; Get(ScriptParameter)] Then, you search for the parameter by Enter Find Mode Set Field[YourEmailField; $param] Perform Find You would send email with the Send Mail script step, using the field YourEmailField as the To: address. The body of the email would be a calculation such as "Your password is " & ThePasswordField & "." To determine completion of the script, have a Set Field[TheFlag; 1] step in the script, and then use newFindCommand('YourEmailField'); getRecords() ; getField('TheFlag') in the php script. Have the php script reset TheFlag.
Create an account or sign in to comment