Page 1 of 1

Want to transfer data continuously between pages

Posted: Thu Mar 27, 2008 2:11 pm
by khushbush
The subject title of this thread doesn't seem to make sense, but basically, what I am trying to do is create a search function, which, btw, works right now...the results are displayed on the following page.
However, what I am trying to do is that when the user sees the result page, they can select a particular result and view further details on it, but on the next page.

My main issue is...how do I do that?

I'm including the code for the search functionality...

<html>
<body>

<?php
//login details have been changed
mysql_connect("server", "username", "password") or die(mysql_error());

mysql_select_db("property") or die(mysql_error()); ?>

<table align = "LEFT">


<?
//select the table
if($_POST['propertyType']=="No Preference" && $_POST['postcode']){
$result = mysql_query("SELECT*FROM property WHERE propertyArea = '$_POST[postcode]'");

$recordcount = mysql_num_rows($result);
$i = 0;// this is just the incremental number
while($i < $recordcount){
// Define the database result for this record into a variable
$price=mysql_result($result,$i,"propertyPrice");
$type=mysql_result($result,$i,"propertyType");
$area=mysql_result($result,$i,"propertyArea");
$image = mysql_result($result, $i, "propertyImage1");
// Now print the results.
?>
<tr>
<td>
<font face="Arial" color="#0B3A62">
<a href = "searchprocess.php">
<?
echo $price . ", " . $type . ", ". $area;

// Now add one more to the incremental number and loop around
++$i;
}
}
?>
</a>
</font>
</tr>
</td>
<?
if($_POST['propertyType']=="Bungalow" && $_POST['postcode']){
$result = mysql_query("SELECT*FROM property WHERE propertyType = 'Bungalow' AND propertyArea = '$_POST[postcode]'");

$recordcount = mysql_num_rows($result);
$i = 0;// this is just the incremental number
while($i < $recordcount){
// Define the database result for this record into a variable
$price=mysql_result($result,$i,"propertyPrice");
$type=mysql_result($result,$i,"propertyType");
$area=mysql_result($result,$i,"propertyArea");
?>
<tr>
<td>

<font face="Arial" color="#0B3A62">
<a href = "searchprocess.php">
<?
// Now print the results.

echo $price . ", " . $type . ", ". $area;

// Now add one more to the incremental number and loop around
++$i;
}
}
?>
</a>
</font>
</tr>
</td>

<?
if($_POST['propertyType']=="House" && $_POST['postcode']){
$result = mysql_query("SELECT*FROM property WHERE propertyType = 'House' AND propertyArea = '$_POST[postcode]'");

$recordcount = mysql_num_rows($result);
$i = 0;// this is just the incremental number
while($i < $recordcount){
// Define the database result for this record into a variable
$price=mysql_result($result,$i,"propertyPrice");
$type=mysql_result($result,$i,"propertyType");
$area=mysql_result($result,$i,"propertyArea");
$image = mysql_result($result, $i, "propertyImage1");
?>
<tr>
<td>
<font face="Arial" color="#0B3A62">
<a href = "searchprocess.php">
<?
// Now print the results.

echo $price . ", " . $type . ", ". $area;

// Now add one more to the incremental number and loop around
++$i;
}
}
?>
</a>
</font>
</tr>
</td>

<?
if ($_POST['propertyType']=="Flat" && $_POST['postcode']){
$result = mysql_query("SELECT * FROM property WHERE propertyType = 'Flat' AND propertyArea = '$_POST[postcode]'");
$recordcount = mysql_num_rows($result);
$i = 0; // this is just the incremental number
while($i < $recordcount){
// Define the database result for this record into a variable
$price=mysql_result($result,$i,"propertyPrice");
$type=mysql_result($result,$i,"propertyType");
$area=mysql_result($result,$i,"propertyArea");
$image = mysql_result($result, $i, "propertyImage1");
?>
<tr>
<td>
<font face="Arial" color="#0B3A62">
<a href = "searchprocess.php">
<?
// Now print the results.

echo $price . ", " . $type . ", ". $area;

// Now add one more to the incremental number and loop around
++$i;

}
}
?>
</a>
</font>
</tr>
</td>
<font face="Arial" color="#0B3A62">
<?
// If there are no records returned, tell the user
if($recordcount == 0){
echo "There are no records returned for your search query.";
}


?>
</font>
</td>
</tr>
</table>
</body>
</html>