[FX.php List] else
Timothy Tait
bottledspider at gmail.com
Thu Jun 15 20:40:33 MDT 2006
a few little suggestions.
--you could try enclosing the statements in internal parens:
if ( ($findResult['email1isempty'][0] == "1") &&
($findResult['email2isempty'][0] == "1") )
sometimes that is necessary, sometimes not.
--another thing, are you sure this field is set to return a string? it
could be returning a bit/boolean, in which case you would need to write
if ( ($findResult['email1isempty'][0] == 1) &&
($findResult['email2isempty'][0] == 1) )
--as a third thought, perhaps php is interpreting it as a literal, in which
case you'd want to use single quotes:
if ( ($findResult['email1isempty'][0] == '1) &&
($findResult['email2isempty'][0] == '1') )
again, all simple little things, but sometimes the devil is in the
details...
-timothy
On 6/15/06, Jonathan Schwartz <jonathan at eschwartz.com> wrote:
>
> Hi Dale,
>
> Good suggestion....but that didn't do it.
>
> Here's the whole page. I had a heck of a time trying to decide where
> the second "}" to end the embedded if statement... the one with the
> double "&&".
>
> In short, there's a test to make sure that an phone number arrived
> from the POST form.
>
> Then, there's the test for finding a single record (that's good) and
> the subsequent test to make sure that there in an email address in
> one of the two email fields. This is the one that is failing. I am
> getting the "detaillost.php" page displaying instead of the desired
> error: A problem was encountered: No email addresses are associated
> with this record....."
>
> The last two tests handle if either O records were found (not good)
> or multiple records were found (yikes!).
>
> Sure would like to figure this one out. I'm trying hard to shed my
> beginner skin,
>
> J
>
>
>
>
>
>
>
> <head>
> <link href="web_style.css" rel="stylesheet" type="text/css">
> </head>
>
> <?php
> include ("FX/FX.php");
> include ("FX/server_data.php");
> include ("session_handler.php");
>
>
> $searchData = array_keys($_REQUEST);
>
>
>
> $phone1=$_GET['phone1'];
>
> $query = new FX($ServerIP, $dataPort, $dataSourceType, $scheme);
> $query->SetDBData ('families.fp7','web0');
> $query->SetDBPassword ($webPW, $webUN);
>
>
> $query->AddDBParam ('phone1', $_POST['phone1'], 'eq');
> #$query->AddDBParam ('phone2', $_POST['phone1'], 'eq');
> #$query->AddDBParam ('password', $password, 'eq');
> $findResult = $query->FMFind();
>
>
> if ($_POST[phone1] == "") {
> $msg= 'Please fill in phone number.';
> include_once ("loginlostpassword.php");
> exit;
> } else { $msg =" ";
>
> }
>
> if ($findResult['foundCount'] == 1) {
>
> $recID=current($findResult['data']);
> $internal=explode('.',key($findResult['data']));
> $internalRecID=$internal[0];
>
>
> if ($findResult['email1isempty'][0] == "1" &&
> $findResult['email2isempty'][0] == "1") {
>
>
> $msg = "A problem was encountered:
> No email addresses are associated with this record. Please
> contact us for assistance.";
> include_once ("loginlostpassword.php");
> exit;
>
> }else{
> $msg = " ";
> include_once ("includes/header.php");
> include_once("detaillost.php");
> exit;
>
> }
>
> } else {
>
> if ($findResult['foundCount'] > 1) {
>
> $msg = "A problem was encountered: Duplicate records with the
> same phone number were found. Please contact us for assistance.";
> include ("loginlostpassword.php");
>
> } else {
>
> $msg = "Your phone number was not found. Please try again.";
> include ("loginlostpassword.php");
>
> }
> }
> ?>
>
>
>
>
> --
>
> Jonathan
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
>
--
give a man a fire, and keep him warm for a day.
set a man on fire, and keep him warm for the rest of his life.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.iviking.org/pipermail/fx.php_list/attachments/20060615/0b76ae25/attachment-0001.html
More information about the FX.php_List
mailing list