Jump to content

[SOLVED] Simple question for someone!


le007

Recommended Posts

<tr>
<td align="left">
<font size=2 face="arial" color="#65066"><b>Bedrooms</b></font>
</td>
<td align="left">
<select name="numberofrooms">
HERE;
include("select/numrooms.inc.php");
echo <<<HERE
</select></td>
</tr>

 

Above is my code - what I'd like is: if proptype == whatever then NOT to include the bedroom select option but enter a value of 1 for it. Something like this (but its not working at present)

 

<tr>
HERE;
if ($property_type == "Agricultural Land" || $property_type == "Business" 

|| $property_type == "Cafe/Deli" || $property_type == "Commerical Site" 

|| $property_type == "Development Site" || $property_type =="Farm Land" 

|| $property_type == "Franchises" || $property_type == "Garage" || 

$property_type == "Health and Beauty" || $property_type == "Hotels/B+Bs" 

|| $property_type == "Industrial Unit" || $property_type == "Investment" 

|| $property_type == "Licensed Premises" || $property_type == "New 

Developments" || $property_type == "Office Share" || $property_type == 

"Office Unit" || $property_type == "Parking Space"){
echo "";
}else if ($property_type == "Public House" || $property_type == "Retail 

Unit" || $property_type == "Shops" || $property_type == "Supermarkets" || 

$property_type == "Warehouse Unit"){
echo "<input type='hidden' name='numberofrooms' value='1'>";
} else {
echo "<td align='left'>";
echo "<font size=2 face='arial' color='#650066'><b>Bedrooms</b></font>";
echo "</td>";
echo "<td align='left'>";
echo "<select name='numberofrooms'>";
include("select/numrooms.inc.php");
echo "</select></td>";
}
ECHO <<<HERE
</tr>

Link to comment
https://forums.phpfreaks.com/topic/73575-solved-simple-question-for-someone/
Share on other sites

i'm not sure what your asking for but .. maybe..

<?php
if(!empty($property_type))
{
echo "<input type='hidden' name='numberofrooms' value='1'>";
} else {
echo "<td align='left'>";
echo "<font size=2 face='arial' color='#650066'><b>Bedrooms</b></font>";
echo "</td>";
echo "<td align='left'>";
echo "<select name='numberofrooms'>";
include("select/numrooms.inc.php");
echo "</select></td>";
}
?>

Thanks for the reply

 

Its a long story - kinda complicated but basically if the $prop_type equals any of the given types eg Agricultural land or Business etc to EXCLUDE bedrooms - otherwise it'll be a residential edit meaning that bedrooms will have to be an option.

 

(hope that makes sense)

you mean this ?

*re-formatted

<?php

if(
$property_type == "Agricultural Land" || 
$property_type == "Business" || 
$property_type == "Cafe/Deli" || 
$property_type == "Commerical Site" || 
$property_type == "Development Site" || 
$property_type =="Farm Land" || 
$property_type == "Franchises" || 
$property_type == "Garage" || 
$property_type == "Health and Beauty" || 
$property_type == "Hotels/B+Bs" || 
$property_type == "Industrial Unit" || 
$property_type == "Investment" || 
$property_type == "Licensed Premises" || 
$property_type == "New Developments" || 
$property_type == "Office Share" || 
$property_type == "Office Unit" || 
$property_type == "Parking Space")
{
echo "<input type='hidden' name='numberofrooms' value='1'>";
}elseif(
$property_type == "Public House" || 
$property_type == "Retail Unit" || 
$property_type == "Shops" || 
$property_type == "Supermarkets" || 
$property_type == "Warehouse Unit")
{
echo "<td align='left'>";
echo "<font size=2 face='arial' color='#650066'><b>Bedrooms</b></font>";
echo "</td>";
echo "<td align='left'>";
echo "<select name='numberofrooms'>";
include("select/numrooms.inc.php");
echo "</select></td>";
}

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.