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.

get(hostname), get(myname)?

Featured Replies

I would like to restrict certain functionality depending on whether the host or a client is trying to access it.

I thought I would compare the 'host name' to 'client name' or 'host IP' to 'client IP'.

I know where I can get the host name and host IP address for the database, but don't see a way to 'Get' either of the client data.

If they aren't available, how do I test in a script whether it is the host or a client that is accessing the script?

Please check if Get(UserCount) will fit your aim. Because if it's >1 the user is a client.

The statement "whether the host or a client is trying to access it" does not make sense to me.

The host never accesses a file.

If you are referring to a file hosted using FM Server, and asking how to know whether a script is being run by FM Server (as a server-side script) then use the Get( ApplicationVersion ) function.

  • Author

The application is not on a server. My users' installations typically may have one or 2 other computers wanting to share the file.

The 'host' is the main activity hub of their installation and does most of the accessing of the file, but others may access the application via iPad, or other networked computer.

'Get(HostName)' gives me the name of the 'hub' computer - the computer that hosts the file - from whichever computer i check (as I would expect).

I want to know when the iPad/Computer trying to access a script is NOT the host computer. If I could 'Get' the name of the computer requesting the script be run I could compare the names.

Get(usercount) doesn't do it since it gives the same result from any active networked device - host or client.

Still looking for a solution!! Is there a way to 'Get' the Name of the current computer? Please help.

I want to know when the iPad/Computer trying to access a script is NOT the host computer. If I could 'Get' the name of the computer requesting the script be run I could compare the names.

Ok, you're using FMP to host the file, not FMS. Which means there is ALWAYS one user -- the host computer's copy of FMP. All other users should be >1.

Get(usercount) doesn't do it since it gives the same result from any active networked device - host or client.

Still looking for a solution!! Is there a way to 'Get' the Name of the current computer? Please help.

Get( UserCount ) SHOULD do the trick. Make sure the calculation is unstored. If the calculation is stored then it will never update.

However, the Get( MultiUserState ) function is specifically designed for this purpose. It should return 1 when evaluated from the host computer and 2 if evaluated from a client. Remember to make this calculation unstored as well.

  • Author

'Get(multiuserstate)' seems to do the trick. With the host and one client running, the result is '1' on the host and '2' on the client.

Thanks!

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.