[FX.php List] How to force evaluation of both User and password fields

Jonathan Schwartz jonathan at eschwartz.com
Thu Sep 15 01:39:16 MDT 2005


I'm using the Dogwalk example to build a logon front end.  The 
current script requests both user name and password. When both are 
filled in FMP uses both.  However, if one is left blank, then 
FileMaker uses only the one that is filled in.

How do I overcome,  preferably to test for field contents as a first step.

Current php follows. Thanks

<?
include ("FX.php");
include ("prefs.php");
include ("session_handler.php");


$query = new FX($serverIP, $port);

$query->SetDBData ('Walker.fp5', 'web');

$query->AddDBParam ('username', $_POST['name'], 'eq');
$query->AddDBParam ('password', $_POST['pw'], 'eq');

$result = $query->FMFind();

if ($result['foundCount'] == 1) {
	session_set_save_handler("sess_open","sess_close","sess_read","sess_write","sess_destroy","sess_gc");
	setcookie("sid");
	session_start();

	if ($exp) {
			$msg = " Your session has expired.  You must 
login again.";
			include_once ("logon.php");
			exit;
	}

	$recID = current($result['data']);

	session_register("sessWalkerID");
	session_register("sessWalkerName");

	$sessWalkerID = $recID['WalkerID'][0];
	$sessWalkerName = $recID['WalkerName'][0];

	echo "Loggin in... one moment please";
	echo "<meta http-equiv=refresh 
content=\"1;url=index.php?area=show_schedule\">";

	exit;

} else {
	$msg = "Unsucessful login attempt.  Please try again.";
	include ("logon.php");

}

?>

-- 

Jonathan Schwartz
Schwartz & Company
817 Marin Drive
Mill Valley, CA 94941
Phone: 415-381-1852
jonathan at eschwartz.com - http://www.eschwartz.com



More information about the FX.php_List mailing list