Jump to content

if statements and includes


ltoto

Recommended Posts

what i want to do is i have an option in the SQl table called hotel type, where the type can either be hotel, villa or golf,

what i want it to do is

e.g

if the type = hotel , then show pages/hotel.php on Id=18

if type= villa, then show pages/villa.php on Id=19

if type=golf, then show pages/golf.php on Id=20

any suggestions.....
Link to comment
https://forums.phpfreaks.com/topic/24437-if-statements-and-includes/
Share on other sites

<?php
switch($row_rsHotel['hotelType'])
{
case 'Hotel':
if(@$_GET['Id']== "15")
include "pages/country.php";
break;

case 'Villa':
if(@$_GET['Id']== "3")
include "pages/country.php";
break;


default:
// default action
break;
}
?>


i tried this but it did not work..... any suggestions as to what i should do, i got no error

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.