Solved

Form Page - Results Page - Detail Page

Posted on 2008-06-11
14
253 Views
Last Modified: 2012-08-14
I am trying to create a form page - pass the data to a results page - and then link it to detail page. I am confused about which recordsets to use and how to the link the pages together. I have created a form page with a recordset for each form element so that I can populate the menus dynamically. I have identified the results page in the Action field.

The form page has 4 elements - MinPrice, MaxPrice, City and Beds in a form named BasicSearch. The question is how do I pass the data from the form elements to the varialbles in the results page? I have tested the recordset on the results page using different default settings and it works fine.

The final part is to be able to display the detail page - I've done this before and think I can figure it out but I remain confused about passing form elements to varialbles so the recordset can funciton properly

R Nicolais
0
Comment
Question by:rnicolais
  • 7
  • 7
14 Comments
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 21762634
Hi rnicolais,

I am assuming you are using PHP?

If the form is set to method=post then each form field ends up in the $_POST array or in DW recordset lingo: Form Parameters.  If your form is set to method=get, then the form fields get sent to the $_GET array and also appear in the URL.  For DW purposes, these are URL Parameters.

In either case, the textfield name is the variable name, so what you do is set up the recordset on the results page to filter by Form or URL parameter and use the variable name to match to the table column.  Once you have the recordset, you need to use the unique ID in a link to pass information via the URL to filter the details recordset:

<a href=detail.php?id="<?php echo $row_rsRecordset['IDColumn']; ?>">Details</a>

Then the detail recordset filters by URL Parameter "id" (from the id= above) matching against whatever the ID column is.
0
 

Author Comment

by:rnicolais
ID: 21763616
Yes, that is correct I am using PHP
I have set the search page action to post
I have named my variables the same as the form elements (MaxPrice form element - MaxPrice variable)
Since I am working in the advance record set I'm not sure about the filter but I have set up the varialbles like this:
varialbe name - MaxPirice
type=numerice
default = 1000000
run time = $_Post['Price']
the WHERE part of the recordset for this reads - "property.city<=Maxprice"
obviously I'm missing something because it still doesn't work - ideas?
Ron Nicolais
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 21763688
>> run time = $_Post['Price']

If you set the form fields to have the same names, this should be:

$_Post['MaxPrice']

Try working with the simple recordset generator first...fill in the all of the fields, then switch to advanced to see how DW creates the variables...
0
 

Author Comment

by:rnicolais
ID: 21763952
Gave that a try with the city field - the simple set inserts  colname (City = colname) is this some sort of default? what happens when you want sort multiple fields?
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 21764005
DW generated code is...odd.  If you look at the advance screen again, you will see colname is defined below the query and it has a runtime value of -1 and another value of $_POST['City'].  

If you then ok the recordset and go to code view, you will see everything that DW generates to make a simple recordset call.  There's a lot going on.  Once you get the hang of how DW wants those variables defined in the advanced view, you can switch over there and add variables and place the markers in the code to generate filters on multiple variable.  

To be honest, I don't muck about with the wizards.  I write a simple recordset then switch to code view and alter the PHP as I need to or I just write my own recordset calls. Now, if you can write your own PHP code and you know what you are doing, then there is no reason to use the DW wizards EXCEPT that you will lose the ability to use the Bindings panel with your own code.
0
 

Author Comment

by:rnicolais
ID: 21764275
Yes, I understand the - 1 and $_Post['city'] unfortunately it's not working. I can enter a city in the default instead of the -1 and the record set works fine I just can't get form value into variable for some reason- I'm not a programer so it's difficult to understand whats going on or in this case not going on. Even when I enter a simple record set now nothing works - I know I can get a simple recordset to work eventually but I need to have a more refined search - there must be an answer to this I've seen humdreds of inquireis on the web and everyone has the same problem - if you think of something else go ahead and post it -- I've been at this for several days and don't seem to be any closer

R Nicolais
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 21764541
Post your form page code and results page code.
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Author Comment

by:rnicolais
ID: 21764815
I appreciate your effort - this thing has been making me crazy for days!!
<?php require_once('Connections/IxHudConnect.php'); ?>

<?php

if (!function_exists("GetSQLValueString")) {

function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 

{

  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
 

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
 

  switch ($theType) {

    case "text":

      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";

      break;    

    case "long":

    case "int":

      $theValue = ($theValue != "") ? intval($theValue) : "NULL";

      break;

    case "double":

      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";

      break;

    case "date":

      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";

      break;

    case "defined":

      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;

      break;

  }

  return $theValue;

}

}
 

$maxRows_Rslts = 10;

$pageNum_Rslts = 0;

if (isset($_GET['pageNum_Rslts'])) {

  $pageNum_Rslts = $_GET['pageNum_Rslts'];

}

$startRow_Rslts = $pageNum_Rslts * $maxRows_Rslts;
 

mysql_select_db($database_IxHudConnect, $IxHudConnect);

$query_Rslts = "SELECT * FROM property";

$query_limit_Rslts = sprintf("%s LIMIT %d, %d", $query_Rslts, $startRow_Rslts, $maxRows_Rslts);

$Rslts = mysql_query($query_limit_Rslts, $IxHudConnect) or die(mysql_error());

$row_Rslts = mysql_fetch_assoc($Rslts);
 

if (isset($_GET['totalRows_Rslts'])) {

  $totalRows_Rslts = $_GET['totalRows_Rslts'];

} else {

  $all_Rslts = mysql_query($query_Rslts);

  $totalRows_Rslts = mysql_num_rows($all_Rslts);

}

$totalPages_Rslts = ceil($totalRows_Rslts/$maxRows_Rslts)-1;

?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/GreenBackground.dwt.php" codeOutsideHTMLIsLocked="false" -->

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<!-- InstanceBeginEditable name="doctitle" -->

<title>TheHudster Home Page</title>

<!-- InstanceEndEditable -->

<style type="text/css"> 

<!-- 

body  {

	font: 100% Verdana, Arial, Helvetica, sans-serif;

	background: #666666; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */

	padding: 0;

	text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */

	color: #000000;

	margin: 0;

}

.twoColFixRtHdr #container {

	width: 780px;

	margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */

	border: medium groove #FF0000;

	text-align: left; /* this overrides the text-align: center on the body element. */

	background-color: #000000;

} 

.twoColFixRtHdr #header {

	height: 90px;

	width: 780px;

	padding-top: 0;

	padding-bottom: 0;

} 

.twoColFixRtHdr #header h1 {

	margin: 0; /* zeroing the margin of the last element in the #header div will avoid margin collapse - an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse */

	padding: 10px 0; /* using padding instead of margin will allow you to keep the element away from the edges of the div */

}

.twoColFixRtHdr #sidebar1 {

	float: right; /* since this element is floated, a width must be given */

	width: 150px;

	padding-top: 7px;

	padding-right: 10px;

	padding-bottom: 15px;

	padding-left: 10px;

	background-color: #333333;

	border-top-width: thick;

	border-right-width: thick;

	border-bottom-width: thick;

	border-left-width: thick;

	border-left-style: groove;

	border-top-color: #FF0000;

	border-right-color: #FF0000;

	border-bottom-color: #FF0000;

	border-left-color: #FF0000;

}

.twoColFixRtHdr #mainContent {

	margin-top: 0px;

	margin-right: 190px;

	margin-bottom: 0;

	margin-left: 5px;

	padding-top: 10px;

	padding-right: 20px;

	padding-bottom: 0;

	padding-left: 20px;

	background-color: #CCFFCC;

} 

.twoColFixRtHdr #footer { 

	padding: 0 10px 0 20px; /* this padding matches the left alignment of the elements in the divs that appear above it. */

	background:#DDDDDD; 

} 

.twoColFixRtHdr #footer p {

	margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */

	padding: 10px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */

}

.fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */

	float: right;

	margin-left: 8px;

}

.fltlft { /* this class can be used to float an element left in your page */

	float: left;

	margin-right: 8px;

}

.clearfloat { /* this class should be placed on a div or break element and should be the final element before the close of a container that should fully contain a float */

	clear:both;

    height:0;

    font-size: 1px;

    line-height: 0px;

}

--> 

</style>

<!--[if IE 5]>

<style type="text/css"> 

/* place css box model fixes for IE 5* in this conditional comment */

.twoColFixRtHdr #sidebar1 { width: 220px; }

</style>

<![endif]-->

<!--[if IE]>

<style type="text/css"> 

/* place css fixes for all versions of IE in this conditional comment */

.twoColFixRtHdr #sidebar1 { padding-top: 30px; }

.twoColFixRtHdr #mainContent { zoom: 1; }

/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */

</style>

<![endif]-->

<link href="HUDSTER.css" rel="stylesheet" type="text/css" />

<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>

<link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />

<script type="text/javascript">

<!--

function MM_preloadImages() { //v3.0

  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

}

function MM_swapImgRestore() { //v3.0

  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;

}

function MM_findObj(n, d) { //v4.01

  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

  if(!x && d.getElementById) x=d.getElementById(n); return x;

}
 

function MM_swapImage() { //v3.0

  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

}

//-->

</script>

<style type="text/css">

<!--

.style3 {color: #FFFFFF}

.Copy10PointBlack {font-size: 10pt}

.style8 {font-size: 8pt}

.style10 {

	font-size: 100%;

	color: #0000FF;

}

.style11 {color: #00FF00}

-->

</style>

<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->

</head>
 

<body class="twoColFixRtHdr" onload="MM_preloadImages('Images/Partners/Home Warranty Rollover.jpg','Images/Partners/Financing Rollover.jpg','Images/Partners/Home Inpsection Rollover.jpg','Images/Partners/Carpet Cleaning Rollover.jpg','Images/Partners/New Carpet Rollover.jpg','Images/Partners/Heating Rollover.jpg')">
 

<div id="container">

  <div id="header"><!-- end #header -->

    <img src="Images/WebPageImages/Header.jpg" width="780" height="90" /></div>

  <div class="RedHorizontalBar"></div>

    <div id="HorizontalMenuContainer"><div id="HorizontalMenu">

    <ul id="MenuBar1" class="MenuBarHorizontal">

        <li>

          <div align="center"><a href="#">Home</a> </div>

        </li>

        <li><a href="SearchInput.php" class="MenuBarItemSubmenu">Owner Occupant</a>

          <ul>

            <li><a href="#">Search</a></li>

          </ul>

        </li>

        <li>

          <div align="center"><a href="InvestorsHomePage.php" class="MenuBarItemSubmenu">Investors</a>

            <ul>

              <li><a href="#">Financing</a></li>

            </ul>

          </div>

        </li>

        <li>

          <div align="center"><a href="BrokerAd.php">Brokers</a> </div>

        </li>

          <li>

            <div align="center"><a href="PartnerPage.php">Advertising</a></div>

        </li>

        <li>

          <div align="center"><a href="#">Contact Us</a></div>

        </li>

    </ul>

    <div class="RedHorizontalBar"></div>

  </div></div>

  

 

  <div id="sidebar1">

   <h3 align="center" class="style3">Buyers Service Center</h3>

   <div class="Partners"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Finance','','Images/Partners/Financing Rollover.jpg',1)"><img src="Images/Partners/Financing Up.jpg" name="Finance" width="150" height="90" border="0" id="Finance" /></a></div>

   <div class="Partners"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('HomeInspection','','Images/Partners/Home Inpsection Rollover.jpg',1)"><img src="Images/Partners/Home Inspection Up.jpg" alt="Home Inspection" name="HomeInspection" width="150" height="90" border="0" id="HomeInspection" /></a></div>

   <div class="Partners"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('HomeWarranty','','Images/Partners/Home Warranty Rollover.jpg',1)"><img src="Images/Partners/Home Warranty Up.jpg" alt="Home Warranty" name="HomeWarranty" width="150" height="90" border="0" id="HomeWarranty" /></a></div>

   <div class="Partners"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('CarpetCleaning','','Images/Partners/Carpet Cleaning Rollover.jpg',1)"><img src="Images/Partners/Carpet Cleaning Up.jpg" alt="Carpet Cleaning" name="CarpetCleaning" width="150" height="90" border="0" id="CarpetCleaning" /></a></div>

   <div class="Partners"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('NewCarpet','','Images/Partners/New Carpet Rollover.jpg',1)"><img src="Images/Partners/New Carpet Up.jpg" alt="New Carpet" name="NewCarpet" width="150" height="90" border="0" id="NewCarpet" /></a></div>

   <div class="Partners"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Heating','','Images/Partners/Heating Rollover.jpg',1)"><img src="Images/Partners/Heating and AC Up.jpg" alt="Heating &amp; Air Conditioning" name="Heating" width="150" height="90" border="0" id="Heating" /></a></div>

   <p align="center" class="style3">&nbsp;</p>

  </div><div class="style3" id="HudHomePlusFHALoan">

    <h2><em>Hud Homes + FHA Loans = <span class="style11">Opportunity</span></em><span class="style11"></em></span><em><span class="style11">!</span></em></h2>

  </div>

    <div id="mainContent"><!-- InstanceBeginEditable name="EditGreenRegion" -->

      <?php do { ?>

        <div id="Summary">

          <table width="100%" border="1" cellspacing="2" cellpadding="2">

            <tr>

              <td width="18%" rowspan="4">&nbsp;</td>

              <td width="18%"><div align="center"><span class="style8"><?php echo $row_Rslts['Price']; ?></span></div></td>

              <td colspan="2" class="style8"><div align="center"><?php echo $row_Rslts['Address']; ?>&nbsp; <?php echo $row_Rslts['City']; ?>,&nbsp; <?php echo $row_Rslts['State']; ?>&nbsp; <?php echo $row_Rslts['Zip']; ?></div></td>

            </tr>

            <tr>

              <td class="style8"><div align="center"><?php echo $row_Rslts['CaseNbr']; ?></div></td>

              <td colspan="2" class="style8"><div align="center"><span class="style8"><?php echo $row_Rslts['Beds']; ?></span> Bdrm(s)&nbsp;&nbsp; <?php echo $row_Rslts['Baths']; ?>&nbsp; <?php echo $row_Rslts['SqFt']; ?> Sq. Ft.</div></td>

            </tr>

            <tr>

              <td rowspan="2">&nbsp;</td>

              <td width="34%" class="style8"><div align="center">Owner Occupant Deadline</div></td>

              <td width="30%" class="style8"><div align="center">Investors</div></td>

            </tr>

            <tr>

              <td class="style8"><div align="center"><?php echo $row_Rslts['OwnerOcc']; ?></div></td>

              <td class="style8"><div align="center"><?php echo $row_Rslts['Investor']; ?></div></td>

            </tr>

          </table>

        </div>

        <?php } while ($row_Rslts = mysql_fetch_assoc($Rslts)); ?><!-- InstanceEndEditable -->

      <div id="FairHousing">

      <div align="justify"><span class="style8">We are pledged to the letter and spirit of  U.S. policy for the achievement of equal housing opportunity throughout the  Nation. We encourage and support an affirmative advertising and marketing  program in which there are no barriers to obtaining housing because of race,  color, religion, sex, handicap, familial status, or national origin. All real  estate advertised herein is subject to the Federal Fair Housing Act, which  makes it illegal to advertise &quot;any preference, limitation, or discrimination  because of race, color, religion, sex, handicap, familial status, or national  origin, or intention to make any such preference, limitation, or discrimination.&quot;  We will not knowingly accept any advertising for real estate which is in  violation of the law. All persons are hereby informed that all dwellings  advertised are available on an equal opportunity basis</span>.</div>

    </div>

  </div>

  <div id="footer">

    <p align="justify">&nbsp;</p>

  <!-- end #footer --></div>

<!-- end #container --></div>
 

<script type="text/javascript">

<!--

var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});

//-->

</script>

</body>

<!-- InstanceEnd --></html>

<?php

mysql_free_result($Rslts);

?>
 

Search Page

<?php require_once('Connections/IxHudConnect.php'); ?>

<?php

//WA Database Search Include

require_once("WADbSearch/HelperPHP.php");

?>

<?php

//WA Database Search (Copyright 2005, WebAssist.com)

//Recordset: property;

//Searchpage: BasicSearch.php;

//Form: form1;

$WADbSearch1_DefaultWhere = "";

if (!session_id()) session_start();

if ((isset($_POST["WADbSearch1"])) && ($_POST["WADbSearch1"] != "")) {

  $WADbSearch1 = new FilterDef;

  $WADbSearch1->initializeQueryBuilder("MYSQL","1");

  //keyword array declarations
 

  //comparison list additions

  $WADbSearch1->addComparison("Price","".WADS_stripCurrency($_POST["minPrice"])  ."","AND",">=",1);

  $WADbSearch1->addComparison("Price","".WADS_stripCurrency($_POST["maxPrice"])  ."","AND","<=",1);

  $WADbSearch1->addComparisonFromList("City","City","AND","=",0);

  $WADbSearch1->addComparisonFromList("Beds","Beds","AND","=",1);
 

  //save the query in a session variable

  if (1 == 1) {

    $_SESSION["WADbSearch1_BasicSearch"]=$WADbSearch1->whereClause;

  }

}

else     {

  $WADbSearch1 = new FilterDef;

  $WADbSearch1->initializeQueryBuilder("MYSQL","1");

  //get the filter definition from a session variable

  if (1 == 1)     {

    if (isset($_SESSION["WADbSearch1_BasicSearch"]) && $_SESSION["WADbSearch1_BasicSearch"] != "")     {

      $WADbSearch1->whereClause = $_SESSION["WADbSearch1_BasicSearch"];

    }

    else     {

      $WADbSearch1->whereClause = $WADbSearch1_DefaultWhere;

    }

  }

  else     {

    $WADbSearch1->whereClause = $WADbSearch1_DefaultWhere;

  }

}

$WADbSearch1->whereClause = str_replace("\\''", "''", $WADbSearch1->whereClause);

$WADbSearch1whereClause = '';

?>

<?php

if (!function_exists("GetSQLValueString")) {

function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 

{

  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
 

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
 

  switch ($theType) {

    case "text":

      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";

      break;    

    case "long":

    case "int":

      $theValue = ($theValue != "") ? intval($theValue) : "NULL";

      break;

    case "double":

      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";

      break;

    case "date":

      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";

      break;

    case "defined":

      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;

      break;

  }

  return $theValue;

}

}
 

mysql_select_db($database_IxHudConnect, $IxHudConnect);

$query_property = "SELECT * FROM property";

setQueryBuilderSource($query_property,$WADbSearch1,false);

$property = mysql_query($query_property, $IxHudConnect) or die(mysql_error());

$row_property = mysql_fetch_assoc($property);

$totalRows_property = mysql_num_rows($property);
 

mysql_select_db($database_IxHudConnect, $IxHudConnect);

$query_Price = "SELECT * FROM menuPrice";

$Price = mysql_query($query_Price, $IxHudConnect) or die(mysql_error());

$row_Price = mysql_fetch_assoc($Price);

$totalRows_Price = mysql_num_rows($Price);
 

mysql_select_db($database_IxHudConnect, $IxHudConnect);

$query_Beds = "SELECT * FROM Beds";

$Beds = mysql_query($query_Beds, $IxHudConnect) or die(mysql_error());

$row_Beds = mysql_fetch_assoc($Beds);

$totalRows_Beds = mysql_num_rows($Beds);
 

mysql_select_db($database_IxHudConnect, $IxHudConnect);

$query_City = "SELECT * FROM HudCities";

$City = mysql_query($query_City, $IxHudConnect) or die(mysql_error());

$row_City = mysql_fetch_assoc($City);

$totalRows_City = mysql_num_rows($City);

?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/BlankIndexPageBasedTemplate.dwt.php" codeOutsideHTMLIsLocked="false" -->

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<!-- InstanceBeginEditable name="doctitle" -->

<title>TheHudster Home Page</title>

<!-- InstanceEndEditable -->

<style type="text/css"> 

<!-- 

body  {

	font: 100% Verdana, Arial, Helvetica, sans-serif;

	background: #666666; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */

	padding: 0;

	text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */

	color: #000000;

	margin: 0;

}

.twoColFixRtHdr #container {

	width: 780px;

	margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */

	border: medium groove #FF0000;

	text-align: left; /* this overrides the text-align: center on the body element. */

	background-color: #000000;

} 

.twoColFixRtHdr #header {

	height: 90px;

	width: 780px;

	padding-top: 0;

	padding-bottom: 0;

} 

.twoColFixRtHdr #header h1 {

	margin: 0; /* zeroing the margin of the last element in the #header div will avoid margin collapse - an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse */

	padding: 10px 0; /* using padding instead of margin will allow you to keep the element away from the edges of the div */

}

.twoColFixRtHdr #sidebar1 {

	float: right; /* since this element is floated, a width must be given */

	width: 150px;

	padding-top: 7px;

	padding-right: 10px;

	padding-bottom: 15px;

	padding-left: 10px;

	background-color: #333333;

	border-top-width: thick;

	border-right-width: thick;

	border-bottom-width: thick;

	border-left-width: thick;

	border-left-style: groove;

	border-top-color: #FF0000;

	border-right-color: #FF0000;

	border-bottom-color: #FF0000;

	border-left-color: #FF0000;

}

.twoColFixRtHdr #mainContent {

	margin-top: 0px;

	margin-right: 190px;

	margin-bottom: 0;

	margin-left: 5px;

	padding-top: 10px;

	padding-right: 20px;

	padding-bottom: 0;

	padding-left: 20px;

	background-color: #CCFFCC;

} 

.twoColFixRtHdr #footer { 

	padding: 0 10px 0 20px; /* this padding matches the left alignment of the elements in the divs that appear above it. */

	background:#DDDDDD; 

} 

.twoColFixRtHdr #footer p {

	margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */

	padding: 10px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */

}

.fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */

	float: right;

	margin-left: 8px;

}

.fltlft { /* this class can be used to float an element left in your page */

	float: left;

	margin-right: 8px;

}

.clearfloat { /* this class should be placed on a div or break element and should be the final element before the close of a container that should fully contain a float */

	clear:both;

    height:0;

    font-size: 1px;

    line-height: 0px;

}

--> 

</style>

<!--[if IE 5]>

<style type="text/css"> 

/* place css box model fixes for IE 5* in this conditional comment */

.twoColFixRtHdr #sidebar1 { width: 220px; }

</style>

<![endif]-->

<!--[if IE]>

<style type="text/css"> 

/* place css fixes for all versions of IE in this conditional comment */

.twoColFixRtHdr #sidebar1 { padding-top: 30px; }

.twoColFixRtHdr #mainContent { zoom: 1; }

/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */

</style>

<![endif]-->

<link href="HUDSTER.css" rel="stylesheet" type="text/css" />

<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>

<link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />

<script type="text/javascript">

<!--

function MM_preloadImages() { //v3.0

  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

}

function MM_swapImgRestore() { //v3.0

  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;

}

function MM_findObj(n, d) { //v4.01

  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

  if(!x && d.getElementById) x=d.getElementById(n); return x;

}
 

function MM_swapImage() { //v3.0

  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

}

//-->

</script>

<style type="text/css">

<!--

.style3 {color: #FFFFFF}

.Copy10PointBlack {font-size: 10pt}

.style8 {font-size: 8pt}

.style10 {

	font-size: 100%;

	color: #0000FF;

}

.style11 {color: #00FF00}

-->

</style>

<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->

</head>
 

<body class="twoColFixRtHdr" onload="MM_preloadImages('Images/Partners/Home Warranty Rollover.jpg','Images/Partners/Financing Rollover.jpg','Images/Partners/Home Inpsection Rollover.jpg','Images/Partners/Carpet Cleaning Rollover.jpg','Images/Partners/New Carpet Rollover.jpg','Images/Partners/Heating Rollover.jpg')">
 

<div id="container">

  <div id="header"><!-- end #header -->

    <img src="Images/WebPageImages/Header.jpg" width="780" height="90" /></div>

  <div class="RedHorizontalBar"></div>

    <div id="HorizontalMenuContainer"><div id="HorizontalMenu">

    <ul id="MenuBar1" class="MenuBarHorizontal">

        <li>

          <div align="center"><a href="#">Home</a> </div>

        </li>

        <li><a href="SearchInput.php" class="MenuBarItemSubmenu">Owner Occupant</a>

          <ul>

            <li><a href="#">Search</a></li>

          </ul>

        </li>

        <li>

          <div align="center"><a href="InvestorsHomePage.php" class="MenuBarItemSubmenu">Investors</a>

            <ul>

              <li><a href="#">Financing</a></li>

            </ul>

          </div>

        </li>

        <li>

          <div align="center"><a href="BrokerAd.php">Brokers</a> </div>

        </li>

          <li>

            <div align="center"><a href="PartnerPage.php">Advertising</a></div>

        </li>

        <li>

          <div align="center"><a href="#">Contact Us</a></div>

        </li>

    </ul>

    <div class="RedHorizontalBar"></div>

  </div></div>

  

 

  <div id="sidebar1">

   <h3 align="center" class="style3">Buyers Service Center</h3>

   <div class="Partners"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Finance','','Images/Partners/Financing Rollover.jpg',1)"><img src="Images/Partners/Financing Up.jpg" name="Finance" width="150" height="90" border="0" id="Finance" /></a></div>

   <div class="Partners"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('HomeInspection','','Images/Partners/Home Inpsection Rollover.jpg',1)"><img src="Images/Partners/Home Inspection Up.jpg" alt="Home Inspection" name="HomeInspection" width="150" height="90" border="0" id="HomeInspection" /></a></div>

   <div class="Partners"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('HomeWarranty','','Images/Partners/Home Warranty Rollover.jpg',1)"><img src="Images/Partners/Home Warranty Up.jpg" alt="Home Warranty" name="HomeWarranty" width="150" height="90" border="0" id="HomeWarranty" /></a></div>

   <div class="Partners"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('CarpetCleaning','','Images/Partners/Carpet Cleaning Rollover.jpg',1)"><img src="Images/Partners/Carpet Cleaning Up.jpg" alt="Carpet Cleaning" name="CarpetCleaning" width="150" height="90" border="0" id="CarpetCleaning" /></a></div>

   <div class="Partners"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('NewCarpet','','Images/Partners/New Carpet Rollover.jpg',1)"><img src="Images/Partners/New Carpet Up.jpg" alt="New Carpet" name="NewCarpet" width="150" height="90" border="0" id="NewCarpet" /></a></div>

   <div class="Partners"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Heating','','Images/Partners/Heating Rollover.jpg',1)"><img src="Images/Partners/Heating and AC Up.jpg" alt="Heating &amp; Air Conditioning" name="Heating" width="150" height="90" border="0" id="Heating" /></a></div>

   <p align="center" class="style3">&nbsp;</p>

  </div><div class="style3" id="HudHomePlusFHALoan">

    <h2><em>Hud Homes + FHA Loans = <span class="style11">Opportunity</span></em><span class="style11"></em></span><em><span class="style11">!</span></em></h2>

  </div>

    <div id="mainContent"><!-- InstanceBeginEditable name="EditGreenRegion" -->

    <form name="form1" action="BasicSearch.php" method="post">

      <div align="center">

        <table cellpadding="2" cellspacing="0" border="0">

          <tr>

            <td align="right"><label for="minPrice">

              <div align="center">Price Range

                </label>

            </div></td>

            <td>

              <div align="center">

                <select name="minPrice">

                  <?php

do {  

?>

                  <option value="<?php echo $row_Price['PriceValue']?>"<?php if (!(strcmp($row_Price['PriceValue'], $row_Price['PriceValue']))) {echo "selected=\"selected\"";} ?>><?php echo $row_Price['PriceLabel']?></option>

                  <?php

} while ($row_Price = mysql_fetch_assoc($Price));

  $rows = mysql_num_rows($Price);

  if($rows > 0) {

      mysql_data_seek($Price, 0);

	  $row_Price = mysql_fetch_assoc($Price);

  }

?>

                </select>

                &nbsp;

                <label for="maxPrice">

                To:

                </label>

                &nbsp;

                <select name="maxPrice">

                </select>

              </div></td>

          </tr>

          <tr>

            <td align="right"><label for="City">

              <div align="center">Select

                </label>

            </div></td>

            <td>

              

              <div align="left">

                  <select name="City">

                    <?php

do {  

?>

                    <option value="<?php echo $row_City['Cities']?>"<?php if (!(strcmp($row_City['Cities'], $row_City['Cities']))) {echo "selected=\"selected\"";} ?>><?php echo $row_City['Cities']?></option>

                    <?php

} while ($row_City = mysql_fetch_assoc($City));

  $rows = mysql_num_rows($City);

  if($rows > 0) {

      mysql_data_seek($City, 0);

	  $row_City = mysql_fetch_assoc($City);

  }

?>

                  </select>

              </div></td>

          </tr>

          <tr>

            <td align="right"><label for="Beds">

              <div align="center">Select

                </label>

            </div></td>

            <td>

              

              <div align="left">

                  <select name="Beds">

                    <?php

do {  

?>

                    <option value="<?php echo $row_Beds['BedValue']?>"<?php if (!(strcmp($row_Beds['BedValue'], $row_Beds['BedValue']))) {echo "selected=\"selected\"";} ?>><?php echo $row_Beds['BedLabel']?></option>

                    <?php

} while ($row_Beds = mysql_fetch_assoc($Beds));

  $rows = mysql_num_rows($Beds);

  if($rows > 0) {

      mysql_data_seek($Beds, 0);

	  $row_Beds = mysql_fetch_assoc($Beds);

  }

?>

                  </select>

              </div></td>

          </tr>

          <tr>

            <td align="center" colspan="2"><input type="submit" name="WADbSearch1" value="Submit" /></td>

          </tr>

              </table>

      </div>

    </form>

    <!-- InstanceEndEditable -->

      <div id="FairHousing">

      <div align="justify"><span class="style8">We are pledged to the letter and spirit of  U.S. policy for the achievement of equal housing opportunity throughout the  Nation. We encourage and support an affirmative advertising and marketing  program in which there are no barriers to obtaining housing because of race,  color, religion, sex, handicap, familial status, or national origin. All real  estate advertised herein is subject to the Federal Fair Housing Act, which  makes it illegal to advertise &quot;any preference, limitation, or discrimination  because of race, color, religion, sex, handicap, familial status, or national  origin, or intention to make any such preference, limitation, or discrimination.&quot;  We will not knowingly accept any advertising for real estate which is in  violation of the law. All persons are hereby informed that all dwellings  advertised are available on an equal opportunity basis</span>.</div>

    </div>

    </div>

  <div id="footer">

    <p align="justify">&nbsp;</p>

  <!-- end #footer --></div>

<!-- end #container --></div>
 

<script type="text/javascript">

<!--

var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});

//-->

</script>

</body>

<!-- InstanceEnd --></html>

<?php

mysql_free_result($property);
 

mysql_free_result($Price);
 

mysql_free_result($Beds);
 

mysql_free_result($City);

?>

Open in new window

0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 21764827
Okay, now I'm a little confused....

Since you are using the WebAssist stuff to generate the search, why are you mucking about with DW recordsets?
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 21764858
To expand,

The WebAssist search works differently from form page-> results page -> details page.  Instead, you define a recordset with no filter and a search form and assign the search behavior.  What WA should do for you is add a WHERE clause to the recordset that cannot be true (WHERE 1 = 0 or similar) and it replaces that with a dynamically built WHERE clause based on how the search form has been submitted and what fields are filled out.

You can have a repeat region on that same page to display the results and use the DW Show If behavior to hide it when the recordset is empty.  Alternately, if you want form and results to be on two different pages, then have the form action point to the results page and apply the web assist search behavior to the recordset on the results page.  I think the WA extension is smart enough to pick up the form references, but I'm not sure about that.
0
 

Author Comment

by:rnicolais
ID: 21768646
Regarding WebAssist - I really dislike that program - I guess it's fine if you want them to automate everything but I've found them a nightmare - Again to restate the issue:
I want to set up a Search (with multiple fields) Results - then detail. If I can get the results page with the property filters I pretty confident the Detail page won't be an issue. The problem is and always has been making the search page yield the proper results. As I mentioned before - this is a very common problem - it's given only cursory overview in third party books but no one seems to have a solution.

R Nicolais
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 21772752
Okay.  In this case, you need to check and see which fields are filled in and dynamically build the WHERE yourself.  Nothing that is built in to DW will help you and DW's recordset syntax will most likely hinder you.

How much PHP do you know?
0
 

Author Comment

by:rnicolais
ID: 21773485
I have no problem building complex "WHERE" statements using multiple conditions - they all test fine when I use different default values - the problem continues to be that the values from the forms are not being passed into the variables.

Regarding PHP - very little - I've done som VBA coding for access buth that's about it.

I just seems there has to be a way to accomplish this without a lot of programming
0
 

Accepted Solution

by:
rnicolais earned 0 total points
ID: 21963041
This issue is resolved. It appears the problem was in naming the search elements. It appears you can NOT name a search element such "City" the same as a data base field. Once I changed the names of the elements (example city to fcity) everthing worked fine so I'm going to accept this solution
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now