Jump to content

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>";
}

?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.