fmwebschool.com
Top Experts [learn more]Top 4-10
webko

9743 K
bandmandq

2458 K
Genx

1525 K
4. tcmeyers
5. kbata
6. Martie
7. Hammerton
8. rrenfrow
9. bneeman
10. plegler
Welcome, Guest. Please login or register.
March 31, 2015, 11:01:59 AM

Login with username, password and session length
Search:     Advanced search
Welcome to the FileMaker Web Masters Exchange.  If you have any questions about how to use this forum, please watch the getting started movie at:
http://www.fmwebschool.com/movies/forum1/forum1.html
27862 Posts in 6164 Topics by 1525 Members
Latest Member: alkyred
* Home Help Search Calendar Login Register
+  fmwebschool.com
|-+  Recent Posts
Pages: [1] 2 3 ... 10

 1 
 on: March 30, 2015, 08:03:20 PM 
Started by macwizard - Last post by macwizard
Hello and thanks for your interest/assistance.  I'm using Dreamweaver 3 on Lion and FMStudio 1.9.0. I've had a registration system working for years that now is failing at one spot. 
I'm wondering if the newer browsers have tightened up their conditions for php sessions (I have very little knowledge of php). The first web page after creation of the db record uses the registration ID as a variable, and the failure happens where the redirect is using the unique Record ID. Would it be better to stick with the Reg_ID all the way through? 
The system still works on Firefox 36.0.1 on Lion, but not Safari 6.1.6 or Chrome.  Neither does it work on Windows 7 or 8.  If I cheat, all browsers on Lion and Windows 7 can properly load the failing webpage.  By "cheat", I mean if I manually enter the URL with the proper Record id at the end (e.g. https://cnrc.fmgateway.com/stmt_o_u.php?-recid=2064). BTW, there are underscores, not gaps in that URL.  Here's what has taken place up to that point:

1.  webuser authenticates,
2.  chooses an exam for registration
3.  submits qualifications
4.  the FileMaker registration record is created
5.  user provides two more fields of info and clicks Continue  (this should update the db and redirect to next page)
6.  database is updated properly regarding those two fields (redirect should now take place)
7.  webpage hangs and eventually times out instead of being redirected to the next page

Here is the code of the submit page:
<?php require_once('Connections/CNRC_email_login.php'); ?>
<?php
$further6_edit = $CNRC_email_login->newEditCommand('ExamRegDetails',$_POST['-recid']);
$further6_fields = array('Exam_Location_1'=>$_REQUEST['Exam_Location_1'],'Exam_Location_Suggestion'=>$_REQUEST['Exam_Location_Suggestion'],'ExamLanguagePref'=>$_REQUEST['ExamLanguagePref'],'SpecialNeeds'=>$_REQUEST['SpecialNeeds'],);
foreach($further6_fields as $key=>$value) {
    $further6_edit->setField($key,$value);
}

$further6_result = $further6_edit->execute();

if(FileMaker::isError($further6_result)) fmsTrapError($further6_result,"error.php");

$further6_row = current($further6_result->getRecords());

fmsRedirect('stmt_o_u.php'.'?-recid='.$further6_row->getRecordId());

 // FMStudio v1.0 - do not remove comment, needed for DreamWeaver support ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Untitled Document</title>
</head>

<body>
</body>
</html>

 2 
 on: March 06, 2015, 10:35:58 AM 
Started by PhanMan - Last post by jmrusch
I don't know the answer, but I wanted to validate that you are not the only person who has seen this problem. It has happened randomly in one of my solutions and the only thing I could do was add instructions to refresh if the value list was blank.

The first time I saw this I happened to be at FM DevCon and I had several people (none of them FM Studio users) look at the problem. The unanimous conclusion was a problem with the FM Studio value list function. This was several years ago, and at the time I was very new to PHP so there was no way I was going to mess with FM Studio code. For that particular solution, no one has ever complained so I never bothered to go back and fix it. But I haven't used the FM Studio value list feature in ages because of this problem.

Instead, I use Todd Duell's method (from his excellent book about the FileMaker API for PHP), summarized:

Get the value list (in the example below, the layout is "Demo", the value list and the name of the field with the value list attached are both "MultiValueList" and the connection is $fm):

$layout = $fm->getLayout('Demo');
$multivalues = $layout->getValueList('MultiValueList');

Get the actual values from the MultiValueList field from the record. Then use the explode PHP method to separate the values into an array using the carriage return ("\n") as the separator value:

$values = $record->getField('MultiValueList');
$values = explode ("\n", $values );

Create the html for the multi value list using the values from $values and the $multiValueList value list.

foreach($multiValues as $multiValue)
   {
   if(in_array($multiValue, $values))
      {
      $selected = ' selected';
      }
   else
      {
      $selected = '';
      }         

# Build the final html
# Format will look something like:
# <option value="Dog" selected>Dog</option>
   
   $multiValueList .= '<option value="' . $multiValue . '"' . $selected . '>' . $multiValue . '</option>';
   
   }
$multiValueList .= '</select>';   

Hope that helps.
Julie

 3 
 on: March 05, 2015, 02:40:48 PM 
Started by PhanMan - Last post by PhanMan
I have several forms that pull a value list from the database as a drop down.  Everynow and then when a user goes to the page, the drop down is empty.  The user must refresh or log out of the session and log back in for the drop down to populate from the value list.  There is no recordset on the page.  it just a form.  what is my issue? thanks

 4 
 on: March 03, 2015, 01:28:46 AM 
Started by gwjo - Last post by gwjo
One day later - have solved the problem! In creating the connection it is the database username and password that are required, not the server access username and password. The problem arises because FMStudio allows you to see the database even if the username and password for that database are incorrect. A note on the FMStudioPro Connection window would have been REALLY helpful.

 5 
 on: March 02, 2015, 06:27:05 AM 
Started by gwjo - Last post by gwjo
I'm struggling to get a new connection with table based login to work:
I've set up the site without any problems, gone to add FMStudio Pro connection with table based login and I get as far as selecting the database of interest. It finds the database, the test says the connection was made successfully, it gives the login page as login.php but no layouts in the pulldown menu (and also thus no user name or password fields).
Any suggestions on what I might have missed or what I can check gratefully received!
Regards,
George

 6 
 on: February 15, 2015, 03:48:16 AM 
Started by cooldude - Last post by kimosabi
Did this ever get solved?  I am having a similar problem with IIS on server 2008 R2 sp1.  I can actually write php code by hand using the fmstudio pro class and have it return results but not have all the automated things work.  I do believe this to be a permission issue in IIS but I have compared the settings on this new server to another one that I had been upgrading versions on over the years and did not see where the discrepancy exists. I can keep hand-coding but it sure would be nice to be able to use the features of fmstudio pro that we paid for.

 7 
 on: January 29, 2015, 05:59:05 PM 
Started by cooldude - Last post by cooldude
ok getting somewhere...

I see that I can use this
$emp_result->getRecords();

with sort like below...


and this gets me 1 field sorted - NICE...

Q: but how do I sort on 2 or more fields with this or another php command?


 <?php
         

 // sort by last name
 usort($emp_result->getRecords(),
 function ($a, $b) {
     return strcmp(
         $a->getField(‘LastName’),
         $b->getField('LastName')
     );
 });
 
 ?>


 8 
 on: January 29, 2015, 03:38:32 PM 
Started by cooldude - Last post by cooldude
Hi - not really knowing what I am doing here - but when I did a --- print_r($test_result->getRecords());


it shows what is below....

Q: any idea how to POST PROCESS SORT THIS --- $test_result->getRecords() or just --- $test_result Huh

---


Array (
  • => FileMaker_Record Object ( [_impl] => FileMaker_Record_Implementation Object (
  • [_fields] => Array ( [Date Entered] => Array (
  • => 05/05/1997 ) [Date Mod] => Array (
  • => 06/05/2008 ) [Name] => Array (
  • => xxx ) [SAP_ID] => Array (
  • => 17 ) [Address] => Array (
  • => xxx ) [City] => Array (
  • => Bakersfield ) [State] => Array (
  • => Ca. ) [Zip] => Array (
  • => 93301 ) [First] => Array (
  • => ) [Last] => Array (
  • => ) ) [V5e7ec2d5] => Array ( ) [_recordId] => 17 [_modificationId] => 3 [_layout] => FileMaker_Layout Object ( [_impl] => FileMaker_Layout_Implementation Object ( [_fm] => FileMaker_Implementation Object ( [V73ee434e] => Array ( [charset] => utf-8 [locale] => en [logLevel] => 3 [hostspec] => xxx [recordClass] => FileMaker_Record [prevalidate] => [database] => page1


etc.

 9 
 on: January 29, 2015, 01:48:39 PM 
Started by cooldude - Last post by cooldude
? HOW DO I SORT THESE RESULTS ?

ANOTHER METHOD - but needs SORTING!!!


Q: How do I sort this special query?

here's another way I got the combined result....

----------



I needed to do a special fmstudio query


- needed complex search so I did this

- basic fmstudio query finds just one person id (which will not fail) do not need this data - just for not fail

- RAN SCRIPT like this - gets complex query fine... ---  $emp_find->SetScript('script1','=='.$params_here);

--then had  this but SORT does NOT WORK ........
$emp_find->addSortRule('lastname',1,FILEMAKER_SORT_ASCEND);



– so my results loop ok -  BUT NO SORT!

- i even tried putting a sort step in the FM script

- no sort seems to work

- I even looked into post process resorting the results after getting the query (array_multisort Huh?) but can't seem to get it working....



Q: How do I fix this issue and get the results to sort how I need them??


 10 
 on: January 29, 2015, 01:45:26 PM 
Started by cooldude - Last post by cooldude
You do two queries, and then combine the data arrays after (assuming they are using the same fields...), and then display the combined set

Thanks much webko

sounds good - a few questions

I'm confused by fmstudio query items

my query called = emp
and query 2 = emp2...

------------------


1 - $emp_result = $emp_find->execute();

2 -  $emp_row = current($emp_result->getRecords());

then I loop through like this on ....

<?php foreach($emp1_result->getRecords() as $emp1_row){ ?>
display here…
<?php } ?>

Q: so what method do I use to COMBIME THEM both emp1 and emp2?

Q: THEN what function do I use to SORT the final array?

these =  array_merge() to merge both arrays ---- and usort() for sorting the merged array?


not sure how to set this up....


Thanks in advance for you're help

Pages: [1] 2 3 ... 10
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!