[FX.php List] else

Steve Winter steve at bluecrocodile.co.nz
Thu Jun 15 05:23:32 MDT 2006


Jonathan,

The first thing that strikes me is in the line;
	if ($_POST[phone1] == "") {
You're missing the quotes from the parameter name, it needs to be;
	if ($_POST['phone1'] == "") {

I'm also confused by the fact that in one place you set;
	$phone1=$_GET['phone1'];
But then the if statement above is using $_POST... Are users arriving at
this page via a GET or a POST... The rest of the page makes me think post,
in which case $phone1 is going to be null when you do the search later in
the page...

Couple of ideas which will hopefully get you closer to where you need to be
:-)

Cheers
Steve


-----Original Message-----
From: fx.php_list-bounces at mail.iviking.org
[mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of Jonathan Schwartz
Sent: Thursday, 15 June 2006 3:54 p.m.
To: FX.php Discussion List
Subject: Re: [FX.php List] else

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





More information about the FX.php_List mailing list