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 19, 2014, 11:00:55 PM

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
|-+  Recent Posts
Pages: 1 [2] 3 4 ... 10

 11 
 on: March 18, 2014, 02:43:09 PM 
Started by MBUST - Last post by jmrusch
I think what you propose should work. The ['user'] and ['pass'] are just a couple of items in the $_SESSION['RegisteredMbr_login'] array that FM Studio sets up and since you're bypassing $_SESSION['RegisteredMbr_login'] you don't need to worry about them.


I don't know enough about FM Studio's security to know if what you're proposing is safe, but since you essentially want to bypass the user's credentials anyway, maybe you don't care.

 12 
 on: March 18, 2014, 10:15:27 AM 
Started by xtrim - Last post by PhanMan
The key part of this is the fmod of the counter - that is the remainder after being divided by the given number.

For any table with n columns, there are three possibilities for each row cell - it's the left one (mod = 0) or it's the right one (mod = n - 1) or it's a middle one (any other result)

So, for three column, something like:

Code:
<table>
<?php
$i 
0//Set a counter
$n 3//Number of columns - this can be changed to any value from 2 upwards
foreach(fmsValueListItems($employee,'Details','ProgramAccessList',"") as $list_item_key=>$list_item) {
//We are now inside the loop - check if it's left, right or middle
if (fmod ($i,$n) == 0) {
//Left column - we need to start a row 
$trstart "<tr>""; 
$trend = "";
} elseif (fmod ($i,$n) = $n - 1) {
//Right column - we need to end the row
$trstart = "";
$trend="
</tr>/n";
} else {
//must be a middle column, no start or end row tags required
$trstart = "";
$trend="";
}
if( fmsCompareSet($list_item, $print_row->getField('ProgramAccess')) ) {
echo $trstart; //Will ony have a value for left col
echo "
<td><input name="ProgramAccess[{$list_item_key}]\" type=\"checkbox\" value=\"{$list_item}\" checked=\"checked\">{$list_item}</td>";
echo $trend;
} else {
echo $trstart;
echo "<td><input name=\"ProgramAccess[{$list_item_key}]\" type=\"checkbox\" value=\"{$list_item}\">{$list_item}</td>";
echo $trend//Will only have a value for right col
}
$i++; //Increment the counter
}
?>

</table>

Not tested, but should work...

Thanks Webko but the 3 column code didnt work.  however the 2 column code above works.

 13 
 on: March 18, 2014, 08:55:23 AM 
Started by MBUST - Last post by MBUST
Ok, let me rephrase my question, as I'm still unclear.  I understand that the above is the connection file, but I also know that this interacts in ways that I don't understand and that perhaps don't need to know to log someone in.  So here's my question:  In the following code:
Code:
$username_RegisteredMbr = "username";
$password_RegisteredMbr = "1234567890";
$Lusername_RegisteredMbr = $_SESSION['RegisteredMbr_login']['user'];
$Lpassword_RegisteredMbr = $_SESSION['RegisteredMbr_login']['pass'];
$RegisteredMbr = new FileMaker($database_RegisteredMbr, $hostname_RegisteredMbr, $Lusername_RegisteredMbr, $Lpassword_RegisteredMbr);
fmsCheckFirstLogin('RegisteredMbr','login.php',$RegisteredMbr);

these variables
$username_RegisteredMbr = "username";
and
$password_RegisteredMbr = "1234567890";
are the variables that Dreamweaver uses to log in for development, and

$Lusername_RegisteredMbr = $_SESSION['RegisteredMbr_login']['user'];
$Lpassword_RegisteredMbr = $_SESSION['RegisteredMbr_login']['pass'];

are the variables that the user enters to login.  But what if I change $Lusername_RegisteredMbr and $Lpassword_RegisteredMbr for

 $Lusername_RegisteredMbr =  "username";
$Lpassword_RegisteredMbr = "1234567890"; ?

Should I somehow add the last bits, ['user'] and ['pass'], respectively? What are those bits for?

Thanks.

Max




 14 
 on: March 16, 2014, 04:06:15 AM 
Started by frogringer - Last post by frogringer
thanks. yes i've switched to filemaker go but sadly i didn't sync fmtouch before upgrading to mavericks so there is some data i need to get from the iPhone to the computer.
i'm using fmtouch v 1.660
cheers

 15 
 on: March 15, 2014, 02:26:08 PM 
Started by carmean - Last post by carmean
I created a new 'website' using the PHP Site Assistant (from Filemaker Server 11) and found this difference between the new recordlist.php (which behaves as expected) and my older recordlist.php.

The new code retains search results and seems to work fine.  Thank you for your suggestions- I did not know where to start.

Code:
    //  handle the action cgi
    $action = $cgi->get('-action');
    if ($action == "findall")
    {
        $cgi->clear('skip');
        $findAll = true;
    }

        // clear the recid
           $cgi->clear('recid');

        // create a find command
           $findCommand = $fm->newFindCommand($layoutName);
           ExitOnError($findCommand);

        // get the posted record data from the findrecords page
           $findrequestdata = $cgi->get('storedfindrequest');
           if (isset($findrequestdata)) {
               $findCom = prepareFindRequest($findrequestdata, $findCommand, $cgi);


        // set the logical operator
       $logicalOperator = $cgi->get('-lop');
       if (isset($logicalOperator)) {
               $findCom->setLogicalOperator($logicalOperator);
       }
       } else
           $findCom = & $fm->newFindAllCommand($layoutName);
   
    ExitOnError($findCom);

'Bad' Code:
Code:
    //  handle the action cgi  (CODE DOES NOT SHOW SEARCH RESULTS when you come back to the page)
    $action = $cgi->get('-action');
    switch ($action) {
        case "findall": {
           $cgi->clear('skip');
           $findCom = & $fm->newFindAllCommand($layoutName);
           $findAll = true;
           break;
        }
        case "find": {
        // clear the recid
           $cgi->clear('recid');

        // create a find command
           $findCommand = $fm->newFindCommand($layoutName);
           ExitOnError($findCommand);

        // get the posted record data from the findrecords page
           $findrequestdata = $cgi->get('storedfindrequest');
           if (isset($findrequestdata)) {
               $findCom = prepareFindRequest($findrequestdata, $findCommand, $cgi);

            // set the logical operator
               $logicalOperator = $cgi->get('-lop');
               if (isset($logicalOperator)) {
                       $findCom->setLogicalOperator($logicalOperator);
               }
           } else
               $findCom = $fm->newFindAllCommand($layoutName);
           break;
        }
        default: {
           $findCom = & $fm->newFindAllCommand($layoutName);
           break;
        }
    }
    ExitOnError($findCom);

 16 
 on: March 14, 2014, 02:31:19 PM 
Started by MBUST - Last post by MBUST
Hello everyone,

I'm working on a database with a damaged security menu (as explained in a recent post).  I'm trying to switch to a table login system instead of the problematic account based system (problematic--and very slow--when there are hundreds of accounts).  Unfortunately, now FMStudio cannot connect to the database to generate a login page (though the database is running generally fine and serving data). 

So I would like to modify manually the connection file (and other related ones), but I don't know what that file looks like.  This does not work:

Code:
<?php
// FMStudio v2 - do not remove comment, needed for DreamWeaver support
# FileName="PHP_FMStudio2_Login.htm"
# Type="FMStudio2"
# FMStudio2="true"
$path preg_replace("#^(.*[/\\\\])[^/\\\\]*[/\\\\][^/\\\\]*$#",'\1',__FILE__);
set_include_path(get_include_path() . PATH_SEPARATOR $path);
require_once(
'FileMaker.php');
require_once(
'FMStudio_v2/FMStudio_Tools.php');
fmsCheckLogin('RegisteredMbrSpecial','loginStart.php');
$hostname_RegisteredMbrSpecial "6286.datatrium.com";
$database_RegisteredMbrSpecial "OptimumClients";
$username_RegisteredMbrSpecial "username";
$password_RegisteredMbrSpecial "0987654321";
$Lusername_RegisteredMbrSpecial $_SESSION['RegisteredMbr_login']['user'];
$Lpassword_RegisteredMbrSpecial $_SESSION['RegisteredMbr_login']['pass'];
$RegisteredMbrSpecial = new FileMaker($database_RegisteredMbrSpecial$hostname_RegisteredMbrSpecial$username_RegisteredMbrSpecial$password_RegisteredMbrSpecial); 
fmsCheckFirstLogin('RegisteredMbrSpecial','loginStart.php',$RegisteredMbrSpecial);
?>

For some reason, I'm returned to the login page every time I try to log in. What I expected was to be sent to another page when the login happens and a page checks to see if the user and its password correspond within a table.  I don't even know what file is sending me back to the log in page, as all the ones I've check are not set to redirect to the login page.

Can someone tell me or point me to where I can see the connection file that I should be using?

Thank you!

Max

 17 
 on: March 13, 2014, 11:01:16 PM 
Started by MBUST - Last post by MBUST
Hi Webko and others,

I've modified the Connection file but when I try to run it, it always returns me to the login page again, instead of the actual page I want, so the logging process must be failing.  I wonder if that has to do with the fact that I'm using a regular account-based login instead of a table based login, when what I want is the table based login.  (Really, what I want is just to log in with a stock username and password, and then do a search on a table an assign session variables as needed).  But I see that the FMStudio_Tools does have a reference to table based login, but I'm not using that.  And, especially you, Webko, since you don't use FM Studio, what does the connection file would look for you?  FM studio includes a require_once('FMStudio_v2/FMStudio_Tools.php'); that is surely something you don't use. 

Thanks.

Max

 18 
 on: March 13, 2014, 09:56:41 PM 
Started by macwizard - Last post by macwizard
I have an existing website created years ago in DW CS3 and FMStudio 1.8.2.  It is connected with an FM db, both hosted at FMGateway.  Everything works.  But when I try to create a new connection and fill in the connection form using exactly the same data as an existing, working connection, I get this error when trying to select a database for the connection: "It seems the FileMaker API is not installed in this site.  Install it now?"
Of course the API is installed because the whole site/DB pair is working.  It doesn't matter if I click OK , or Cancel.  I get another error: "An unidentified error has occurred."  However, if I open an existing connection config screen for the site, testing succeeds.

I have tried creating new sites and installing the FileMaker API when prompted and I have the same failure to create a new connection.
I am using a Mac with Snow Leopard and have repaired the hard drive directory and repaired permissions.
The user/pw combo I am entering in the connection form is working already and certainly has the correct Extended Privileges checked.

Can anyone shed some light on this please?  Thanks very much.

 19 
 on: March 12, 2014, 03:44:20 PM 
Started by xtrim - Last post by webko
The key part of this is the fmod of the counter - that is the remainder after being divided by the given number.

For any table with n columns, there are three possibilities for each row cell - it's the left one (mod = 0) or it's the right one (mod = n - 1) or it's a middle one (any other result)

So, for three column, something like:

Code:
<table>
<?php
$i 
0//Set a counter
$n 3//Number of columns - this can be changed to any value from 2 upwards
foreach(fmsValueListItems($employee,'Details','ProgramAccessList',"") as $list_item_key=>$list_item) {
//We are now inside the loop - check if it's left, right or middle
if (fmod ($i,$n) == 0) {
//Left column - we need to start a row 
$trstart "<tr>""; 
$trend = "";
} elseif (fmod ($i,$n) = $n - 1) {
//Right column - we need to end the row
$trstart = "";
$trend="
</tr>/n";
} else {
//must be a middle column, no start or end row tags required
$trstart = "";
$trend="";
}
if( fmsCompareSet($list_item, $print_row->getField('ProgramAccess')) ) {
echo $trstart; //Will ony have a value for left col
echo "
<td><input name="ProgramAccess[{$list_item_key}]\" type=\"checkbox\" value=\"{$list_item}\" checked=\"checked\">{$list_item}</td>";
echo $trend;
} else {
echo $trstart;
echo "<td><input name=\"ProgramAccess[{$list_item_key}]\" type=\"checkbox\" value=\"{$list_item}\">{$list_item}</td>";
echo $trend//Will only have a value for right col
}
$i++; //Increment the counter
}
?>

</table>

Not tested, but should work...

 20 
 on: March 12, 2014, 09:35:55 AM 
Started by xtrim - Last post by PhanMan
Assuming by 'columns' you mean a table like structure, then try (note, this is not elegant, but it is simple)

Code:
<table>
<?php
$i 
0//Set a counter
foreach(fmsValueListItems($employee,'Details','ProgramAccessList',"") as $list_item_key=>$list_item) {
//We are now inside the loop - check if it's column 1 or column 2
if (fmod ($i,2) == 0) {
//Left column - we need to start a row 
$trstart "<tr>""; 
$trend = "";
} else {
//Right column - we need to end the row
$trstart = "";
$trend="
</tr>n";
}
if( fmsCompareSet($list_item, $print_row->getField('ProgramAccess')) ) {
echo $trstart; //Will ony have a value for left col
echo "
<td><input name="ProgramAccess[{$list_item_key}]\" type=\"checkbox\" value=\"{$list_item}\" checked=\"checked\">{$list_item}</td>";
echo $trend;
} else {
echo $trstart;
echo "<td><input name=\"ProgramAccess[{$list_item_key}]\" type=\"checkbox\" value=\"{$list_item}\">{$list_item}</td>";
echo $trend//Will only have a value for right col
}
$i++; //Increment the counter
}
?>

</table>

How would i make it if i want 3 columns?

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