January 10, 200818 yr Newbies Trying out the new 9.0 web PHP. In 6.0, I used to put a "-script" tag and run the script after I create a new record. The script sets fields in the record after it is created. In PHP, I put this in the confirmation page: $recid = $record->getField('current_record_ID', 0); $findCommand =& $fm->newFindCommand('WebRegistration'); $findCommand->addFindCriterion('current_record_ID', $recid); $findCommand->setPreSortScript('TEST2','22'); $result = $findCommand->execute(); The script runs and changes the field in the database, but what is displayed on the confirmation page is the value before the script is run. Also, do I need to do the findcommand? -Thanks!
January 11, 200818 yr After you run the find, do you refresh the PHP variables in your web page before displaying the confirmation information? Below is a sample that works successfully for me: $BillingActivate=new FX($serverIP,$webCompanionPort); $BillingActivate->SetDBData($fmFile,'webngUsers', $groupSize); $BillingActivate->SetDBPassword($webPassword,$webUser); $BillingActivate->AddDBParam('KEY',$KEY); $BillingActivate->AddDBParam('-script.presort','LocalActivateAcc'); $BillingActivateResult=$BillingActivate->FMfind(); foreach( $BillingActivateResult[ 'data' ] as $key => $activateData ) { $recid = $activateData['recid'][0]; $UID = $activateData['UID'][0]; $KEY = $activateData['KEY'][0]; $Organisation = $activateData['Organisation'][0]; $nameFirst = $activateData['NameFirst'][0]; $nameLast = $activateData['NameLast'][0]; ... etc etc } ... now generate the necessary HTML including the changed variables you want to display on the confirmation page. HTH
Create an account or sign in to comment