AnsweredAssumed Answered

How to use html form to POST to XML Custom Web Publishing?

Question asked by skywillmott on Oct 5, 2017
Latest reply on Oct 6, 2017 by skywillmott

I'm not sure if I'm missing something simple, or that it just can't be done... But here is the situation:

 

I can add records to the hosted FileMaker file using a properly structured URL using XML publishing, such as:

 

https://user:password@my.server.here/fmi/xml/FMPXMLRESULT.xml?-db=myDatabase&-lay=myLayout&-new&myField=fieldContent

 

... which creates a new record in 'myDatabase' with the field called 'myField' populated with the data 'fieldContent'

 

This works great. However, I would like to POST data from an HTML form in a similar way, but cannot get it to work using POST.

 

The html looks like:

 

<form action="https://user:password@my.server.here/fmi/xml/FMPXMLRESULT.xml" method="POST">

<input type="hidden" name="-db" value="myDatabase">

<input type="hidden" name="-lay" value="myLayout">

<input type="hidden" name="-new" value="">

Naam <input type="text" name="myField">

<input type="submit">

</form>

 

But it doesn't work. I get error 4, the command not recognised. I'm guessing because the '-new' input is empty.. Have tried using '-new' as the value for '-new', but no luck.

 

However, it does work when I change the form method to 'GET', though really I would like it to use POST.

 

I'm sure there must be something simple I am missing... Any ideas?

 

Thank you...

Outcomes