cath Posted March 21, 2005 Author Posted March 21, 2005 Hello! I have an online database and I would like to monitor the number of request made to the database. More specifically, I would like to know how many times the Submit button has been hit. Can anyone help me with that? Thank you! Catherine
cath Posted March 21, 2005 Posted March 21, 2005 Hello! I have an online database and I would like to monitor the number of request made to the database. More specifically, I would like to know how many times the Submit button has been hit. Can anyone help me with that? Thank you! Catherine
Reed Posted March 22, 2005 Posted March 22, 2005 Add one more script step to your submit button script. It will increment the value of a counter field (In one record in a separate table) by 1. If you actually want to know the date and time of the submission, then add a step where a record is created in a separate table with an auto enter timestamp field. The number of records in that table will be the number of times the script is run. Dana
cath Posted March 22, 2005 Author Posted March 22, 2005 That's what I would do if I was working directly in FileMaker, but is it possible to do quite the same with a Submit button in a Web interface? Something like modifying this <input name="-find" type="submit"> so that it increments the value of a counter field? Thanks for any help! Catherine
Garry Claridge Posted March 22, 2005 Posted March 22, 2005 Do you want to store that value in a logging database or elsewhere? If it is in a logging database you can use an [FMP-InlineAction] at the head of each Format page to increment the the log/counter. Good Luck. Garry
cath Posted March 22, 2005 Author Posted March 22, 2005 Hello and thanks for your replies, I would like that each time someone hits the Submit button to query DatabaseA::TableA, a new record is created in DatabaseA::TableB. Values will calculate themselves automatically so I don't need to worry about entering a value. I know I can use this to find records: <input name="-find" type="submit"> or this to create a new record : <input name="-new" type="submit">. But can I do a mix of the two? So that it finds records from TableA and creates a new record in TableB Note: I am using XSLT style sheets. Thanks again for your help! Catherine
Steve T. Posted March 23, 2005 Posted March 23, 2005 Howdy, Cath! Huh. -find and -new are CDML like stuff that I would have thought you would NOT be able to do in FM7, but assuming you can or assuming your are using FM4-6, Garry's suggestion of using an INLINE ACTION would probably be the way to go.. in fact, the CDML Reference Database even mentions a logging action as an example of how an inline can be used. Your search would be the -find you noted and the inline would be on the following page (visible or not to the web user... up to you). We used an inline logging db as a web counter and it worked well. You'd be doing the same thing, but just counting the web pages after the search action. You can also do Reed's script idea as long as you don't need exact figures. Scripts-over-the-web don't always work as one would hope and near-simultaneous executions may cause 1 not to run at all so you'll lose some counts but it's probably good enough to give you a rough idea. --ST
cath Posted March 23, 2005 Author Posted March 23, 2005 Hello again! I wasn't aware one could execute a script from the web, so this could be a solution. But I would still prefer if I could do this otherwise. Due to my poor vocabulary related to web programming, an exemple will be the best way to explain myself. Here's an exemple of the form I'm using to post users query to the database (TableA) (My database is hosted on FileMaker Server 7 Advanced and I am using XSLT stylesheets): <form method="post"> <xsl:attribute name="action">recordlist_en.xsl</xsl:attribute> <input> <xsl:attribute name="type">hidden</xsl:attribute> <xsl:attribute name="name">-lay</xsl:attribute> <xsl:attribute name="value">MyLayout</xsl:attribute> </input> Variable: <select> <xsl:attribute name="name">FieldName.op</xsl:attribute> <option value="eq">is equal to</option> <option selected="selected" value="cn">contains</option> <option value="bw">starts with</option> <option value="ew">ends with</option> <option value="neq">is different from</option> </select> <input size="40" type="text"> <xsl:attribute name="name">FieldName</xsl:attribute> <xsl:attribute name="title">FieldTitle</xsl:attribute> </input> <input name="-find" type="submit"> <xsl:attribute name="value">Search</xsl:attribute> </input> <xsl:text> </xsl:text> <input name="Reset" type="reset"> <xsl:attribute name="value">Refresh</xsl:attribute> </input> </form> So the -find part works well on TableA. I guess if I want to add a new record to TableB, it will have to be outside of this form because it refers to another table. I am also using templates for other types of actions. Maybe the solution would be to combine a template (<xsl:call-template name="myaddrecordtemplate"/>) with this form, but my tries have been unsuccessfull so far.
Martin Brändle Posted March 25, 2005 Posted March 25, 2005 You can execute a script with -script=myscript e.g. <input type="hidden" name="-script" value="myscript"/> There are also: -script.prefind -script.presort if you want to have the script executed before the find/after the find, but before the sort. Another way is to use the XSLT document() function to execute a call to the database. This is the analogue to the [FMP-InlineAction] in CDML. And a really different idea is to forget about counters in the database and to use a tool that analyzes your web log, like Analog.
cath Posted March 29, 2005 Author Posted March 29, 2005 Well, thanks to all of you! I think I'll go with a script, which seems to be the easiest way to get exactly what I want. Best regards, and hoping I can be of some help to someone in turn! Catherine
Recommended Posts
This topic is 7558 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