Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Find email record based on parameter from PHP

Featured Replies

  • 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

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

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.