Skip 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.

Data written to FM twice

Featured Replies

Using FM7SA and FX.php. When I create a new record or edit data using FX.php, the data is written to FileMaker twice. For example, when I create a record for John Doe, FileMaker records each field as a multi-line text field:

First =

John

John

Last =

Doe

Doe

I'm sure the data is being passed to the php page properly. So why is it going to FileMaker twice? Has anyone else had this problem? What is the solution?

Thanks,

Dan

  • Author

By the way, here is the code

<?php

$userEmail = $_POST[userEmail];

$password = $_POST[password];

$userLevel = $_POST[userLevel];

$reason = $_POST[reason];

$userRecID = $_POST[userRecID];

$userTitle = $_POST[userTitle];

$userFirst = $_POST[userFirst];

$userLast = $_POST[userLast];

$userSuffix = $_POST[userSuffix];

$userType = $_POST[userType];

$userPhoneExt = $_POST[userPhoneExt];

$userDirectDial = $_POST[userDirectDial];

$userDirectFax = $_POST[userDirectFax];

$userCell = $_POST[userCell];

$newUserEmail = $_POST[newUserEmail];

$newUserPassword = $_POST[userUserPassword];

# testing here to make sure that each variable contains what I'm expecting it to. It does...

echo "$userTitle <br>";

echo "$userFirst <br>";

echo "$userLast <br>";

echo "$userSuffix <br>";

echo "$userType <br>";

echo "$userPhoneExt <br>";

echo "$userDirectDial <br>";

echo "$userDirectFax <br>";

echo "$userCell <br>";

echo "$newUserEmail <br>";

echo "$newUserPassword <br><br><br>";

$editUserData = new FX($FMAddress, $FMPort);

$editUserData -> setDBUserPass('WebUser' , $FMPassword);

$editUserData -> setDBData('CabiNet.fp7' , 'WebUserInfo'); // params = (the database, the layout)

$editUserData -> AddDBParam('-recid' , $userRecID);

$editUserData -> AddDBParam('UserTitle' , $userTitle);

$editUserData -> AddDBParam('UserFirst' , $userFirst);

$editUserData -> AddDBParam('UserLast' , $userLast);

$editUserData -> AddDBParam('UserSuffix' , $userSuffix);

$editUserData -> AddDBParam('UserType' , $userType);

$editUserData -> AddDBParam('PhoneExtension' , $userPhoneExt);

$editUserData -> AddDBParam('UserDirectDial' , $userDirectDial);

$editUserData -> AddDBParam('UserDirectFax' , $userDirectFax);

$editUserData -> AddDBParam('UserCell' , $userCell);

$editUserData -> AddDBParam('UserEmail' , $newUserEmail);

$editUserData -> AddDBParam('Password' , $newUserPassword);

$editUserDataResult = $editUserData -> FMEdit();

echo "Thank you. Your data have been updated.";

if($debug=='yes'){

echo "<pre>nn";

print_r ($editUserDataResult);

echo "</pre>nn";

}

?>

  • Author

Found out what the problem is. It turns out that FM7SA doesn't play well with the POST method. You can still use the post method for web forms, but you need to communicate with the server using GET.

In FX.php, lines 97 and 98, set the following to false:

var $isPostQuery = false;

var $useCURL = false;

After I did this, no problems. I reported the bug. We'll see if Server 7v3 gets it fixed.

Dan

Sheesh! Who would've thunk it. I hate finding errors in my code, but I think I'd hate it more if it wasn't even my fault. Nice stumble, DB!

--ST

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.