<form name="Form1" method="POST" action="housepurchaseprocess.php" enctype="multipart/form-data" id="Form1" onsubmit="return ValidateForm1(this)">
The above part in bold is a must as that is where the process occurs of the user's purchase but it wont get the session variables...
Code: Select all
<?php
$soldhousesquery = "SELECT Price, HouseType FROM soldhouses ORDER BY Price ASC";
$soldhousesresult = @mysql_query($soldhousesquery) or die(mysql_error());
echo '<select name="houselist" size=10>">';
while($soldhousesrow = mysql_fetch_array($soldhousesresult)) {
echo "<option value=\"{$soldhousesrow['Price']}|{$soldhousesrow['HouseType']}\">£ {$soldhousesrow['Price']} - {$soldhousesrow['HouseType']}</option>";
}
echo '</select>';
?>
</div>
<input type="submit" id="Button2" name="Buy" value="Buy House" style="position:absolute;left:350px;top:600px;width:184px;height:24px;z-index:20">
</form>
<?
//these 2 sessions when echo'd only house type displays but not price
$Price = $_POST['Price'];
$HouseType = $_POST['HouseType'];
$_SESSION['Price'] = $Price;
$_SESSION['HouseType'] = $HouseType;
?>