Jump to content
Sign in to follow this  
VickyLNesbitt

Perpetually creating blank records

Recommended Posts

Hi All

 

I am experiencing a very odd problem with a web form we created for our clients.

 

The web form worked absolutely perfectly on the Apache server we started the clients off on. We're now trying to move them to a new IIS server on a much more powerful machine, however there have been some issues. On entry of the first page a record is created in the database & when the form is posted, that record is edited & continues to be edited on subsequent form pages after filemaker's record ID and the primary key are stored as session variables. NOTE: There is an included page prior to the code I have entered below which sets $ID & $recordID to the value of the session variables for the ID's.

 

A few items of code had to be re-written & these elements now work fine, however I have just noticed a new problem & I have no idea how it is happening...

 

The first step on the first page is to test for the existence of 2 variables. If these variables do not exist a record is created in the database and the 2 variables are set (see below).

if (!isset($ID) AND !isset($recordID)){

	$stepTwoEdit = $fm->newAddCommand('webCandidateFormStepTwo'); 
	$result = $stepTwoEdit->execute();	
	if (FileMaker::isError($result)){
		echo $result->code;
		die();
	}			
	$record=$result->getRecords();
	$recordID=$record[0]->getRecordId();
	$ID=$record[0]->getField('ID');
	session_start();
	$_SESSION['recordID']=$recordID;
	$_SESSION['ID']=$ID;
	session_write_close();
		
}//if record has not yet been created in the database create it so that we have an id

Now this code works perfectly. I have echo-ed the variables onto the page and they are being set correctly & I have done tests to verify that the newAddCommand is only being performed once by echo-ing text inside the if statement.

 

So it appears to all be working correctly, until you go and look in FileMaker.

 

Blank records are being continuously created by the server, despite the fact that the newAddCommand is not being repeated. This command is called once and only once. These records are not just created on page refreshes or on navigation between form pages - they just keep being created every x seconds (there's no consistent interval)...

 

Any ideas?!? Really need to get these clients onto our new server asap, so help would be massively appreciated!

 

Thanks in advance!

 

x

Share this post


Link to post
Share on other sites

The code shown appears correct.  Copy this snippet to a new test file (with the proper FM access prefix) to confirm.

 

The next place to look is if the If() statement shown is inside a loop, or if the entire PHP script is being called repeatedly by another script.

Share this post


Link to post
Share on other sites

Or if Clients are just hitting Refresh in their browsers...

 

Personally, I'd start the session at the beginning of the page and test for the session variables...

 

Cheers

Webko

Share this post


Link to post
Share on other sites

Hi Guys

 

Thanks for your responses!

 

doughemi - I think that's my next step - to start picking out bits of codes and run them separately to try an identify what the problem is.

 

There is no looping anywhere on the page except when I'm picking up value lists much further on in the code & there's definitely nothing else triggering this...

 

webko - refreshing should not be an issue - even if the user refreshes the page the session variable has already been created therefore that if won't validate to true and the newAddCommand won't execute. I've tested this by echoing text inside the if statement - on page entry the text is there, but when I refresh it's not as the session variables have been made and the if does not validate to true. Also the session is started at the beginning of the page - aside from connecting to the DB & a couple of other miscellaneous bits.

 

The weird thing is that on the first page load I can literally sit and watch blank records slowly being added to the database even if I don't refresh the page, it just slowly starts creating the records and does not stop! It's nuts!

 

Vicky

 

x

Share this post


Link to post
Share on other sites

Do you have a redirect anywhere on the page?

 

I've managed to create a loop between two pages that redirected to each other before...

Share this post


Link to post
Share on other sites

Hurrah! Finally gotten round to having another stab at this... And I've only gone and fixed it!

 

Default document for the site with the form on was set to the first page of my form where the record was being created....

 

I changed the default document to a blank html page and BOOM - problem solved.

 

Thanks for your help guys!

Share this post


Link to post
Share on other sites

Ah... that would indeed do it ;-)

 

Good catch

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Similar Content

    • By Richard Carlton
       
      Setting Tax Rates in FM Starting Point | FMSP Videos | FileMaker 16 101 Training
      https://www.youtube.com/watch?v=uuV9jKW0TH8
      Most Recent Upload https://goo.gl/Dbn9fm
      Get up to speed with the FileMaker Pro 16 Video Training Course! 
      Top Rated Course by FileMaker Expert, Richard Carlton.  
      http://learningfilemaker.com/fmpro16.php
      Experience Richard's dynamic and exciting teaching format, while learning both basic, intermediate, and advanced FileMaker development skills. With 26 years of FileMaker experience and a long time speaker at FileMaker's Developer Conference, Richard will teach you all the ins and outs of building FileMaker Solutions.  
      The course is 50 hours of video content!
      Richard has been involved with the FileMaker platform since 1990 and has grown RCC into one of the largest top tier FileMaker consultancies worldwide. 
      Richard works closely with RCC's staff: a team of 28 FileMaker developers and supporting web designers. 
      He has offices in California, Nevada, and Texas.

      Richard has been a frequent speaker at the FileMaker Developers Conference on a variety of topics involving FileMaker for Startups and Entrepreneurs, and client-server integration.

      Richard is the Product Manager for FM Starting Point, the popular and most downloaded free FileMaker CRM Starter Solution.
      Looking for FM Starting Point free software download: http://www.fmstartingpoint.com
      Richard won 2015 Excellence Award from FileMaker Inc (Apple Inc) for outstanding video and product creation, leading to business development.

      RCC, Filemaker Videos, and LearningFileMaker.com are headquartered in Santa Clara, CA.
      http://www.rcconsulting.com/
      Please feel free to contact us at support@rcconsulting.com
      FileMaker Pro is simply a powerful software used to create custom apps that work seamlessly across iPad, iPhone, Windows, Mac, and the web
      Transform your business with the FileMaker Platform
      Free FileMaker Training Videos Channel https://www.youtube.com/user/FileMakerVideos
      50 Hour FileMaker Pro 16 Video Training Course-FileMaker 16 News-Online FileMaker 16 Training Videos
      https://www.youtube.com/watch?v=KpQqLLDcZ8I
      Playlist https://www.youtube.com/watch?v=KpQqLLDcZ8I&list=PLjTvUZtwtgBTMCfjM6LLwBAwGf_yXfvd_&index=13
      Top 10 New Features in FileMaker 16-FileMaker 16 News-FileMaker 16 Instructional Videos-FileMaker 16
      https://www.youtube.com/watch?v=urh8iHOCxkg
      Playlist https://www.youtube.com/watch?v=urh8iHOCxkg&t=130s&index=1&list=PLjTvUZtwtgBTMCfjM6LLwBAwGf_yXfvd_
      Sharing your Database with Other Devices and Users-FileMaker 16 News-FileMaker 16 Database Sharing
      https://www.youtube.com/watch?v=GF82vkYtCtA
      Playlist https://www.youtube.com/watch?v=GF82vkYtCtA&index=8&list=PLjTvUZtwtgBTMCfjM6LLwBAwGf_yXfvd_
      Introduction to FileMaker WebDirect 16-FileMaker 16 News-Online FileMaker 16 Training Videos
      https://www.youtube.com/watch?v=uaZKIpBjMAM
      Playlist https://www.youtube.com/watch?v=uaZKIpBjMAM&list=PLjTvUZtwtgBSVV1-4pFG4SHAhCIP3Yy-I&index=17&t=10s
      FileMaker Behavior Change-Go To Object-FileMaker 16 Video Training-FileMaker 16 News-FileMaker Video
      https://www.youtube.com/watch?v=MFwFjZem3AM
      Playlist https://www.youtube.com/watch?v=MFwFjZem3AM&index=15&list=PLjTvUZtwtgBQVDIUvoRkcvrMLi7sTZmj5
      A database management system (DBMS) is a computer software application that interacts with the user, other applications, and the database itself to capture and analyze data
       
      Official site provides the SDK, Developer's Guide, Reference, and Android Market for the open source project
      http://learningfilemaker.com/FIAS.html
      Video introduction to iOS App Training https://www.youtube.com/watch?v=cVxQe_yAshw
      Free FileMaker videos check out ...http://www.filemakervideos.com
      Download the FileMaker Pro 16 & FileMaker GO 16 for mobile devices training videos at http://www.learningfilemaker.com
      Download FileMaker Go 16 video training at http://learningfilemaker.com/FMGO-16/fmgo16.php
      Download FileMaker 16 Full Video Training Bundle at http://learningfilemaker.com/subscription.php
      FileMaker Video Training Review-FileMaker 16 Video Course Review-FileMaker Pro 16 101 Course Review
      https://www.youtube.com/watch?v=mF6Uor0KmKo
      Playlist https://www.youtube.com/watch?v=mF6Uor0KmKo&list=PLjTvUZtwtgBT8tNHuzF6cOKC_37zCTQl6&index=18
      Use FileMaker to create an app with the FileMaker Training Series
      FileMaker Pro is a cross-platform relational database application from FileMaker Inc.
      Please Comment, Like & Share Our Videos.
      Feel Free to Embed any of Our Videos on Your Blog or Website.
      Follow Us on Your Favorite Social Media
      https://www.facebook.com/FileMakerVideos
      https://twitter.com/filemakervideos
      https://plus.google.com/+FileMakerVideos/videos
      #WhatisFileMaker16
      #FileMakerPro16Training
      #FileMaker16VideoTutorial
      #FileMakerPro16Videos
      https://www.youtube.com/watch?v=uuV9jKW0TH8&index=53&list=PLjTvUZtwtgBTMCfjM6LLwBAwGf_yXfvd_
      http://feeds.feedburner.com/SettingTaxRatesInFmStartingPointFmspVideosFilemaker16101Training
    • By Richard Carlton
       
      PHP VIDEO 2 - Process Walkthrough: https://youtu.be/yAQX0B9Hfyk
      PHP VIDEO 3 - Sample Code Review: https://youtu.be/9thUCa_q_eY
      Download Sample Code: http://fmstartingpoint.com/links/dl_proc.php?idc=CPN_S0067
      Live PHP Page to try out: http://fmstartingpoint.com/links/dl_proc.php?idc=CPN_R0068
      FileMaker CWP Guide: https://fmhelp.filemaker.com/docs/16/en/fms16_cwp_guide.pdf
    • By Jake Thomann
      For anyone interested in an npm package that communicates with Filemaker's data API, I am currently developing here - https://github.com/thomann061/fmrest
    • By gczychi
      Hi,
      I want to access a data base «Import.fmp12» hosted on FMS 16 with the new Rest API but cannot get it to work.
      Testing with «ARC Plugin for Chrome» (great tool, btw) and Postman.
      In ARC, I get the error 802 – Unable to open file; in Postman, I won't even get that far:  «Could not get any response»
       

      This is what I did so far:
       – The file is accessible fine with any FileMaker client using FileMaker username and password (triple checked spelling, etc.)
       – Can connect fine to WebDirect with any browser and http
       – Cannot connect using Rest API and http, so went for https
       – Got an authentication error with https, so
       – Installed a self-signed certificate both on the server Mac and on local Mac for my myowndomain.com
      Getting mixed results:
       – Firefox: myowndomain.com certificate: Error code: SEC_ERROR_UNKNOWN_ISSUER  (to be expected)
       – Safari: FMI Default Certificate: Certificate not valid (host name mismatch). For whatever reason, Safari doesn't use my certificate.
       – Chrome: strikethrough https but shows the WebDirect server
       – ARC Plugin: Using https://myowndomain.com/fmi/rest/api/auth/Import Can get now through to the server (no SSL-Auth problems anymore), but the result is: {"errorMessage": "Unable to open file","errorCode": "802"}
       – Postman: Using https://myowndomain.com/fmi/rest/api/auth/Import «Could not get any response» and an error message: «{"errorMessage":"Method Not Allowed"}»
       
      Any ideas?
      Thanks  for any help.
       
      Gary
       
    • By jamescv7
      XML error: No memory at line 1
      Greetings, this error occurred when the Filemaker API cannot generate a bunch of records. (1000+ records and above)
      I've adjusted the time out settings for PHP even the memory limits.
      Is there any possible solution for this?
       
      According to some information, the error turns out that the 10 MB XML scripts is unchangeable.
      thanks.
×

Important Information

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