Jump to content

ltoto

Members
  • Posts

    162
  • Joined

  • Last visited

    Never

Everything posted by ltoto

  1. hi I want to do a dynamic php menu with alternating colours so for example it would be like this Home - blue Contact - red About - Blue News - red Just basically wondering how I would go about doing something like this? Thanks
  2. http://img355.imageshack.us/img355/2812/design1pk0.jpg final update, im quite pleased with it now
  3. thanks for the comments I did do an update just before you posted: http://img361.imageshack.us/img361/9584/d1ya5.jpg
  4. http://img293.imageshack.us/img293/2446/d1at7.jpg i think it needs bringing to life more, obviously its not finished yet, quite a way off it, i just need some other opinions on where i can improove thanks
  5. i appologise, i dont want it to show noimage.jpg, i just dont want anything to show up
  6. right i simply want to put an if state around this to do the following : if there is no picture, show nothing: around this [code]<li><a href="/pages/showimage0.php?hotelId=<?php echo $row_rsAccom['hotelId'];?>" target="_blank"><img src="../thumb/phpThumb.php?src=../images/hotel_<?php echo $row_rsAccom['hotelImage1']; ?>&w=50&h=50&zc=1&err=../images/noimage1.jpg" border="0"Latest Deals></a></li>[/code]
  7. i used strip_tags, it worked fine, but it cuts the text with a picture, so the picture doesnt show, which is what I want, but it also takes the text characters down more then it should
  8. ahhh that works, but how do i strip tags on it
  9. basically just wondering whats wrong with this <?php substr($row_rsGolf['pagesContent'], 0, 300);?> and why it is not working, its not showing up and error though...
  10. All Ids follow 1st Id, ok, so in a previous post i had a problem where i couldnt show the hotels from a hotelType, and the hoteltype was either Golf, Hotel or villa, I fixed that problem with this code on the hotel display page [code]<?php $type=@$_GET['hotelType']; mysql_select_db($database_conTotal, $conTotal); $query_rsHotels = "SELECT * FROM tabHotel WHERE hotelType ='$type'"; $rsHotels = mysql_query($query_rsHotels, $conTotal) or die(mysql_error()); $row_rsHotels = mysql_fetch_assoc($rsHotels); $totalRows_rsHotels = mysql_num_rows($rsHotels);[/code] but now the problem is that it seems to put all of the hotel types into the hotel, golf, and villa pages , so if its the hotel page, it will also pick up the the golf and villa hotelTypes any suggestions as to why?
  11. ok, its a new day, anyone have any ideas, when i changed the hoteltype part in the like with quotes around it it shows all of the hotels, so maybe its osmething to do with the link? any ideas
  12. sorry for triple post, but does anyone no which page this might be off, the error that is, i have a page called page.php, which this is all included on, and 3 pages, called country.php, country_villa.php,country_golf.php, with the code that shows the country name and region names with thie country, then the code for the hotel page which i just showed.....
  13. or this makes the error go index.php?Id=16&id=1&hotelType='Hotel' i put ' ' around where it says hotel, but it again shows every hotel in every category, instrwad of separting them all
  14. there all just like the one above do you think it could be anything to do with this link index.php?Id=16&id=1&hotelType=Hotel when i take the hotel type bit off, it shows this error Undefined index: hotelType
  15. well on the pages before i have something like this: [code]<?php mysql_select_db($database_conTotal, $conTotal); $query_rsHotellist = "SELECT * FROM tabHotel WHERE hotelType = 'Hotel'"; $rsHotellist = mysql_query($query_rsHotellist, $conTotal) or die(mysql_error()); $row_rsHotellist = mysql_fetch_assoc($rsHotellist); $totalRows_rsHotellist = mysql_num_rows($rsHotellist);[/code]
  16. well it is showing in the SQl table, they can choose which one they want in the Admin panel of the website, with a dropdown menu, this is the code for it [code]<select name="selectType" id="selectType">               <option value="Hotel" <?php if (!(strcmp("Hotel", $row_rsAccomedit['hotelType']))) {echo "SELECTED";} ?>>Hotel</option>               <option value="Villa" <?php if (!(strcmp("Villa", $row_rsAccomedit['hotelType']))) {echo "SELECTED";} ?>>Villa</option>               <option value="Golf" <?php if (!(strcmp("Golf", $row_rsAccomedit['hotelType']))) {echo "SELECTED";} ?>>Golf</option>           </select>[/code]
  17. thanks alot i get thi error showing up Unknown column 'Hotel' in 'where clause' and obviously it changes for the golf and Villa pages
  18. i no your right, but Im trying to get this bit working first, so then the site will be complete, then  iwill need to tidy this up, thanks for all the help you gave me in the past, this is the last bit that needs completing now, and then i can sort out all my bad coding, so if anyone could give me a hand, that would be great... Id represents the page Id, and the small id represents the region id
  19. at the moment, this is the link when you select the villa hotels index.php?Id=20&id=1&hotelType=Villa and with golf it will be index.php?Id=19&id=1&hotelType=Golf and with hotel: index.php?Id=16&id=1&hotelType=Hotel so on the page where all of these are displayed can i just put a get hoteltype from this part: [code]<?php mysql_select_db($database_conTotal, $conTotal); $query_rsHotels = "SELECT * FROM tabHotel WHERE hotelType = hotelType"; $rsHotels = mysql_query($query_rsHotels, $conTotal) or die(mysql_error()); $row_rsHotels = mysql_fetch_assoc($rsHotels); $totalRows_rsHotels = mysql_num_rows($rsHotels);[/code] and how would i do this any suggestions.....
  20. [code]<?php mysql_select_db($database_conTotal, $conTotal); $query_rsHotellist = "SELECT * FROM tabHotel WHERE hotelType = 'Hotel'"; $rsHotellist = mysql_query($query_rsHotellist, $conTotal) or die(mysql_error()); $row_rsHotellist = mysql_fetch_assoc($rsHotellist); $totalRows_rsHotellist = mysql_num_rows($rsHotellist); $sql="SELECT tabCountry.countryName, tabCountry.countryImage, tabRegion.regionName, tabRegion.Id FROM tabCountry , tabRegion  WHERE tabCountry.Id = tabRegion.countryId"; $result = mysql_query($sql); if (!$result) {   die('Invalid query: ' . mysql_error()); } $country = "null"; while ($row = mysql_fetch_array($result, MYSQL_ASSOC)){   $name = $row['countryName'];   if (strcmp($country,$name) !=0){       $country = $row['countryName'];       echo <<<HTML           <br> <div class="homebar2"><h1>$name</h1></div> <div class="country">  <img src="../thumb/phpThumb.php?src=../images/country_{$row['countryImage']}&amp;w=100&amp;h=100&amp;zc=1"  alt="Latest Deals">  </div>          HTML;   } echo <<<HTML <div class="countrycontent"><a href="index.php?Id=16&id={$row['Id']}&hotelType={$row_rsHotellist['hotelType']}">{$row['regionName']}</a><br></div> HTML; } mysql_free_result($rsHotellist); ?> [/code] this is the code to get to the hotels l ist aswell, but i have another page for villa, and golf, where I change the WHERE at the top to either golf of villa, and then at the bottom, change the Id to the right page
  21. well the customer has changed what they wanted [code]?php $colname_rsHotels = "1"; if (isset($_GET['hotelId'])) {   $colname_rsHotels = (get_magic_quotes_gpc()) ? $_GET['hotelId'] : addslashes($_GET['hotelId']); } mysql_select_db($database_conTotal, $conTotal); $query_rsHotels = sprintf("SELECT * FROM tabHotel WHERE hotelId = %s", $colname_rsHotels); $rsHotels = mysql_query($query_rsHotels, $conTotal) or die(mysql_error()); $row_rsHotels = mysql_fetch_assoc($rsHotels); $totalRows_rsHotels = mysql_num_rows($rsHotels); $sql="SELECT * FROM tabHotel WHERE regionId = $id"; $result = mysql_query($sql); if (!$result) {   die('Invalid query: ' . mysql_error()); } while ($row = mysql_fetch_array($result, MYSQL_ASSOC)){   $name = $row['hotelName'];   $description = $row['hotelDescription'];   $rating = $row['hotelRating'];   $image = "<img src=\"../thumb/phpThumb.php?src=../images/hotel_{$row['hotelImage']}&w=100&h=100&zc=1\"  alt=\"Hotel\">";    if ($row['hotelRating'] == 3) {     $star = "../images/star3.jpg";   } else if ($row['hotelRating'] == 4) {     $star = "../images/star4.jpg";   } else if ($row['hotelRating'] == 5) {     $star = "../images/star5.jpg";   } echo "<div class=\"homebar2\"><h1>$name</h1></div>\n";   echo "<div class=\"hotel\">$image</div>\n";   echo "<div class=\"hotelcontent\">" .substr($description, 0, 300) . "...</div>\n";   echo "<h3>Hotel Star: <img src=\"$star\" hspace=\"2\"></h3>\n"; echo "<div class=\"moreinfo\"><a href=\"index.php?Id=22&hotelId=$row[hotelId]\"><img src=\"../images/moreinfo.jpg\" alt=\"moreinfo\" width=\"75\" height=\"18\" border=\"0\"></a></div>\n"; } ?> <? mysql_free_result($rsHotels); ?> [/code] so this is my code where the hotels are displayed, and this is used for the hotel, villa, and golf pages
  22. right this is what i need to do, i have a hotel page, a golf page, and a villa page, when i click on the villa page it shows the list of villas, when i go on the hotel page, it shows the list of hotels, and when i go on the golf page it shows the list of golf hotels. in the sql table i have a feild called hotelType, where in the backend they can select i f the hotel type is either Villa, Golf or Hotel any suggestions as to how to do this please?
  23. [code]<?php mysql_select_db($database_conTotal, $conTotal); $query_rsHotellist = "SELECT * FROM tabHotel WHERE hotelType = 'Hotel'"; $rsHotellist = mysql_query($query_rsHotellist, $conTotal) or die(mysql_error()); $row_rsHotellist = mysql_fetch_assoc($rsHotellist); $totalRows_rsHotellist = mysql_num_rows($rsHotellist); $sql="SELECT tabCountry.countryName, tabCountry.countryImage, tabRegion.regionName, tabRegion.Id FROM tabCountry , tabRegion  WHERE tabCountry.Id = tabRegion.countryId"; $result = mysql_query($sql); if (!$result) {   die('Invalid query: ' . mysql_error()); } $country = "null"; while ($row = mysql_fetch_array($result, MYSQL_ASSOC)){   $name = $row['countryName'];   if (strcmp($country,$name) !=0){       $country = $row['countryName'];       echo <<<HTML           <br> <div class="homebar2"><h1>$name</h1></div> <div class="country">  <img src="../thumb/phpThumb.php?src=../images/country_{$row['countryImage']}&amp;w=100&amp;h=100&amp;zc=1"  alt="Latest Deals">  </div>          HTML;   } echo <<<HTML <div class="countrycontent"><a href="index.php?Id=16&id={$row['Id']}&hotelType='Hotel'">{$row['regionName']}&</a><br></div> HTML; } mysql_free_result($rsHotellist); ?>,[/code] do i put the case code on this page, I also have one for Gold and hotel with the same code, but the type at the top changes and the link at the bottom
  24. right i tried the filter thing but couldnt get it to work, so i am trying this [code] switch($row_rsAccomodation['hotelType']) { case 'Hotel':   if($row_rsPages['Id']== "15")   include "pages/country.php";   break; case 'Villa':   if($row_rsPages['Id']== "3")   include "pages/country_villa.php";   break;      case 'Golf':   if($row_rsPages['Id']== "2")   include "pages/country_golf.php";   break;      default:     break;   } ?>[/code] but it just follows the first Id still
×
×
  • 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.