![]() |
![]() |
||||||
|
|||||||
| Tags: newland, tours |
![]() |
|
|||
|
Can somebody help please.
In Newland Tours (DreamweaverMX or Dreamweaver 8 with asp,coldfusion and php, by Jeffrey Bardzell), there is a problem with the Navigation bar, I think. I have added 5 more tours to Country Italy making 6 tours in total for Italy. If i select Italy from the list/menu (By Country) the first five tours are listed which is ok as Repeat Region is set to 5 but when I click NEXT it jumps to Highlights of Nothern India instead of the 6th tour for Italy, if I click PREVIOUS it jumps to Highlights of Argentina.... Please, please can anybody help and tell me what to do to solve this problem. Many thanks |
| Sponsored Links |
|
|||
|
@Bipalla
Have you compared your code to the code in the Complete folder in the book? The code should be the same. It should not be affected by the number of records in the database. If the code is the same as the completed code example, please post it here and give reference to the page number of the book. Bob |
|
|||
|
Hi Bob,
Thank you very much for your reply. I have installed Newland Tours on my system from the CD (Dreamweaver 8 with ASP, Coldfusion, and PHP ? Jeffrey Bardzell), I have also added 5 more tours in the database to country United Kingdom making it 7 altogether - the Repeat Region was set to 6 on the CD . When you go to Find Tours/By Country and click on United Kingdom, the first 6 tours are displayed fine but when you click NEXT on the Nav Bar it jumps to Highlights of Argentina?. On the above book see pages from 351-361 This is the code: ?> <?php require_once('Connections/conn_newland.php'); ?> <?php $currentPage = $_SERVER["PHP_SELF"]; $maxRows_rs_tourDetail = 6; $pageNum_rs_tourDetail = 0; if (isset($_GET['pageNum_rs_tourDetail'])) { $pageNum_rs_tourDetail = $_GET['pageNum_rs_tourDetail']; } $startRow_rs_tourDetail = $pageNum_rs_tourDetail * $maxRows_rs_tourDetail; mysql_select_db($database_conn_newland, $conn_newland); if (!isset($_POST['tourCountry'])) { if (!isset($_GET['regionID'])) { $query_rs_tourDetail = "SELECT * FROM tbl_tours INNER JOIN tbl_country ON tbl_country.countryID = tbl_tours.country ORDER BY tbl_country.countryName"; } else { $query_rs_tourDetail = "SELECT * FROM tbl_tours INNER JOIN tbl_country ON tbl_country.countryID = tbl_tours.country WHERE tbl_country.region=".$_GET['regionID']." ORDER BY tbl_country.countryName"; } } else { $query_rs_tourDetail = "SELECT * FROM tbl_tours INNER JOIN tbl_country ON tbl_country.countryID = tbl_tours.country WHERE tbl_country.countryName='".$_POST['tourCountry']."' ORDER BY tbl_country.countryName"; } $query_limit_rs_tourDetail = sprintf("%s LIMIT %d, %d", $query_rs_tourDetail, $startRow_rs_tourDetail, $maxRows_rs_tourDetail); $rs_tourDetail = mysql_query($query_limit_rs_tourDetail, $conn_newland) or die(mysql_error()); $row_rs_tourDetail = mysql_fetch_assoc($rs_tourDetail); if (isset($_GET['totalRows_rs_tourDetail'])) { $totalRows_rs_tourDetail = $_GET['totalRows_rs_tourDetail']; } else { $all_rs_tourDetail = mysql_query($query_rs_tourDetail); $totalRows_rs_tourDetail = mysql_num_rows($all_rs_tourDetail); } $totalPages_rs_tourDetail = ceil($totalRows_rs_tourDetail/$maxRows_rs_tourDeta il)-1; $queryString_rs_tourDetail = ""; if (!empty($_SERVER['QUERY_STRING'])) { $params = explode("&", $_SERVER['QUERY_STRING']); $newParams = array(); foreach ($params as $param) { if (stristr($param, "pageNum_rs_tourDetail") == false && stristr($param, "totalRows_rs_tourDetail") == false) { array_push($newParams, $param); } } if (count($newParams) != 0) { $queryString_rs_tourDetail = "&" . htmlentities(implode("&", $newParams)); } } $queryString_rs_tourDetail = sprintf("&totalRows_rs_tourDetail=%d%s", $totalRows_rs_tourDetail, $queryString_rs_tourDetail); ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Newland Tours: Tour Descriptions</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link href="css/newland.css" rel="stylesheet" type="text/css" /> </head> <body> <a href="#top"><img src="images/spacer.gif" alt="Skip to main page content" width="1" height="1" border="0" align="left" /></a> <table width="750" border="0" cellpadding="3" cellspacing="0"> <tr> <td><img src="images/banner_left.gif" width="451" height="68" alt="Newland Tours Banner, Left." /></td> <td width="280"><img src="images/banner_right.jpg" width="276" height="68" alt="Newland Tour Banner, Right." /></td> </tr> <tr> <td><img src="images/navbar.gif" name="navbar" width="450" height="20" border="0" usemap="#navbarMap" alt="Navigation Bar." /></td> <td><img name="copyright_bar" src="images/copyright_bar.gif" width="272" height="20" border="0" alt="Copyright 2006 Newland Tours." /></td> </tr> <tr> <td colspan="2"> <h1><br /> <a name="top" id="top"></a>Tour Descriptions </h1> <p><a href="tours.php">Find Tours</a>: Tour Descriptions </p> <?php do { ?> <hr /> <h2><img src="<?php echo $row_rs_tourDetail['tour_imageURL']; ?>" alt="<?php echo $row_rs_tourDetail['tour_imageALT']; ?>" align="right" /><?php echo $row_rs_tourDetail['countryName']; ?>: <?php echo $row_rs_tourDetail['tourName']; ?></h2> <p>Tour Description: <?php echo $row_rs_tourDetail['description']; ?></p> <p>Number of Nights: <?php echo $row_rs_tourDetail['numNights']; ?></p> <p>Meals Per Day Included: <?php echo $row_rs_tourDetail['meals_per_day']; ?></p> <p>Exercise Required: <?php echo $row_rs_tourDetail['meals_per_day']; ?></p> <table width="60%" border="1" cellspacing="0" cellpadding="3"> <tr> <td>Itinerary:</td> <td><?php echo $row_rs_tourDetail['itinerary']; ?></td> </tr> </table> <p> Learn More About <a href="profiles_detail.php?countryID=<?php echo $row_rs_tourDetail['countryID']; ?>"><?php echo $row_rs_tourDetail['countryName']; ?></a></p> <p>Price This Tour With the <a href="tourprice.php?tourID=<?php echo $row_rs_tourDetail['tourID']; ?>">Tour Price Calculator</a></p> <?php } while ($row_rs_tourDetail = mysql_fetch_assoc($rs_tourDetail)); ?><p> <?php if ($totalPages_rs_tourDetail != 0) { ?> <table width="50%" border="0" align="center" bgcolor="#dddddd"> <tr> <td width="23%" align="center"><?php if ($pageNum_rs_tourDetail > 0) { // Show if not first page ?> <a href="<?php printf("%s?pageNum_rs_tourDetail=%d%s", $currentPage, 0, $queryString_rs_tourDetail); ?>">First</a> <?php } // Show if not first page ?> </td> <td width="31%" align="center"><?php if ($pageNum_rs_tourDetail > 0) { // Show if not first page ?> <a href="<?php printf("%s?pageNum_rs_tourDetail=%d%s", $currentPage, max(0, $pageNum_rs_tourDetail - 1), $queryString_rs_tourDetail); ?>">Previous</a> <?php } // Show if not first page ?> </td> <td width="23%" align="center"><?php if ($pageNum_rs_tourDetail < $totalPages_rs_tourDetail) { // Show if not last page ?> <a href="<?php printf("%s?pageNum_rs_tourDetail=%d%s", $currentPage, min($totalPages_rs_tourDetail, $pageNum_rs_tourDetail + 1), $queryString_rs_tourDetail); ?>">Next</a> <?php } // Show if not last page ?> </td> <td width="23%" align="center"><?php if ($pageNum_rs_tourDetail < $totalPages_rs_tourDetail) { // Show if not last page ?> <a href="<?php printf("%s?pageNum_rs_tourDetail=%d%s", $currentPage, $totalPages_rs_tourDetail, $queryString_rs_tourDetail); ?>">Last</a> <?php } // Show if not last page ?> </td> </tr> </table> <?php } ?> Many thanks for your help. Marie |
|
|||
|
Bipalla,
Just so I am clear, you have copied the completed files directly from the book's CD and only added records to the database? So the code you list above is the same as in the book? I want to know where to focus our troubleshooting. Bob |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
- Contact Us
-|-
Adobe Dreamweaver Forums -|-
Archive -|-
Top -|-Rules/Disclaimer-|-Help/Support-|-Advertise