jasonwood Posted January 7, 2010 Posted January 7, 2010 I need to propose a method for my parent company to add orders to my FileMaker database as they are received on their web site. Is using the PHP API a good way to approach this problem? I am fairly comfortable with PHP and the FileMaker API (I have created a web site where my retailers can place orders, check inventory, etc.) I'm imagining their server would send an HTTPS FORM POST to one of my php files, which would parse the key/value pairs and create the record in FileMaker. Then I guess just use echo to output a "success!" message back to the parent company server (?) as if it were a browser? I'm guessing that could by improved by receiving the order in an XML format - but this is where I get even more confused. I am only familiar with HTTP POST in the context of a browser form submission of key/value pairs. Would the XML content be a "value" for one of the keys, or does the whole key/value thing go out the window when you're talking about server-to-server communication? Is server-to-server communication handled in the same way as browser-to-server communication within php? ie: use $_POST to retrieve the received data , and echo to output a response back to the server? Am I way off track here? Should I be looking at FileMaker's built-in XML/XSLT functionality - I got slightly lost when I looked at that stuff!
Wim Decorte Posted January 16, 2010 Posted January 16, 2010 How are the orders received on the web site? If not directly in FM (through PHP), are they using some other database to receive the orders in? It could be faster to say use ODBC on the FMS machine to connect to that other database and pull everything in that way...
jasonwood Posted January 30, 2010 Author Posted January 30, 2010 They wouldn't know or want to know what FileMaker is and I'm not sure what kind of database they are using, but surely some kind of SQL setup. Main problem with proposing I connect to their database directly, is I have absolutely no idea how I would do that (my knowledge of ODBC and SQL is exactly zero), whereas I know PHP and the FileMaker PHP API fairly well. Is it worth learning ODBC / SQL?
Jason Lane Posted February 1, 2010 Posted February 1, 2010 Using PHP is certainly do-able and probably the best way, especially if you are already familiar with it. Sounds like you're already on the right track. Would the XML content be a "value" for one of the keys, or does the whole key/value thing go out the window when you're talking about server-to-server communication? I believe there's no problem sending the whole XML content as a single value. Then you could insert the XML into a field in your FM DB temporarily, until an internal FM script parses the XML and adds/updates records accordingly. Or, you could parse the XML in your PHP script, then construct the appropriate FM query. Alternatively, you could have the sending DB POST the data as separate key/value pairs (eg. layoutName, fieldName, recID, recData, etc) and then your receiving PHP script can use the received values to construct the appropriate FM query and update the DB that way.
Recommended Posts
This topic is 5400 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now