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.
April 18, 2014, 01:42:52 AM

Login with username, password and session length
Search:     Advanced search
FMWebschool releases more educational FMStudio webinars - check them out here:
http://www.fmwebschool.com/webinars.php
27742 Posts in 6134 Topics by 1525 Members
Latest Member: alkyred
* Home Help Search Calendar Login Register
+  fmwebschool.com
|-+  PHP Web Publishing Technologies
| |-+  FileMaker PHP, FX.php custom web publishing
| | |-+  using isset function with fm php
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: using isset function with fm php  (Read 3690 times)
mandra
Newbie
*
Offline Offline

Posts: 11


using isset function with fm php [Worth 50 Kudos points!]
« on: February 10, 2009, 04:51:14 AM »

Dear All,

I have some difficulties on using the isset function of php with filemaker. For more easy illustration is like this : I have only one page that when I click the find button it will keep the values in each array of $list_control and $list machine. But I often get error that mentioned my connection has lost. The script is like below :
<?php
    require_once ('FileMaker.php');

    $user=$_POST["nama"];
    $pass=$_POST["password"];

    $fm=new FileMaker();
    $fm->setProperty('database','tes');
    $fm->setProperty('hostspec','http://localhost');
    $fm->setProperty('username',$user);
    $fm->setProperty('password',$pass);
    if (FileMaker::isError($fm))
    {
        echo "FM Error : ". $fm->getMessage()."\n";   
    }

    $layout=$fm->getLayout("pdt_daily_control");
    if (FileMaker::isError($layout))
    {
        echo "Layout Error : ". $layout->getMessage()."\n";   
    }

    $list_control=$layout->getValueList("control_item");
    if (FileMaker::isError($list_control))
    {
        echo "List Control Error : ". $list_control->getMessage()."\n";   
    }

    $list_mesin=$layout->getValueList("machine");
    if (FileMaker::isError($list_mesin))
    {
        echo "List Mesin Error : ". $list_mesin->getMessage()."\n";   
    }
   
    if (isset($_POST['cari']))
    {
        echo "start to find process";
    }
?>

and the error that i get is like this :
Layout Error : Communication Error: (22) The requested URL returned error: 401 - This can be due to an invalid username or password, or if the FMPHP privilege is not enabled for that user.
Fatal error: Call to undefined method FileMaker_Error::getValueList() in C:\xampp\htdocs\belajar\login_daily_control.php on line 23

anybody can help me...  Grin

Logged
webko
Global Moderator
Hero Member
*****
Offline Offline

Posts: 2103
Kudos: 9743



WWW
Applications:
« Reply #1 on: February 10, 2009, 01:38:03 PM »

I don't use the API for FileMaker very much, but it looks like your call to the layout isn't working, and so the value list request done next fails completely and aborts the script.

Check very carefully that your layout is called pdt_daily_control and that access via the PHP privilege is allowed for the web user
Logged

tim.webko_at_gmail.com
mandra
Newbie
*
Offline Offline

Posts: 11


« Reply #2 on: February 10, 2009, 11:46:37 PM »

Thanks for your response webko.

But I already set the fmphp enabled on the database SICP Daily Control. For the first login after input the user and password the $list_control and $list_mesin is already filled with the data from the database. But when I use the 'cari' control, it seems like i've lost the connection with the database. Because if I see the response mentioned that there are possibilities that I input the wrong user and password. Like the variable is gone after I click the control. Is there any other way to solve it ? like using session maybe ?

Thanks
Logged
cuitw
Jr. Member
**
Offline Offline

Posts: 35



WWW
« Reply #3 on: August 29, 2013, 09:24:09 PM »

Have you solve the problem mandra? I have exactly the same problem.

Communication Error: (22) The requested URL returned error: 401 - This can be due to an invalid username or password, or if the FMPHP privilege is not enabled for that user.

Oddly enough the file was working perfectly in FM11, I converted the file to FM12 and then the error shows up. No problem using API with other files that I created with FM12, not sure why converted file is not working. I have double checked, PHP are enabled(privilege set) for the user I use in PHP and extended privilege for PHP is enabled.

Any help will be appreciated.
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!