close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

View Details and next/last page buttons not working

Thread began 2/23/2012 5:11 pm by hostmaster336780 | Last modified 2/24/2012 4:42 pm by Jason Byrnes | 1314 views | 10 replies |

hostmaster336780

View Details and next/last page buttons not working

View Details and next/last page buttons not working on my results page and I can't find why any help would be nice thank you... My testing site is www.cwsontheweb.com

Attached Files
index.zip
Sign in to reply to this post

Jason ByrnesWebAssist

i dont see where the results are being displayed on your site. Please give some details for how to get to the search and results.

Sign in to reply to this post

hostmaster336780

it is at the bottom of the index.php page (page_more26) starting at line 999 also getting Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/content/87/8825987/html/index.php:10) in /home/content/87/8825987/html/WADbSearch/HelperPHP.php on line 11 at the top of my results page

Sign in to reply to this post

Jason ByrnesWebAssist

yes, i see it in your code, but when i go to the link you provided, i do not see it in the browser, so am not able to investigate, I am asking how to see the results on your site to reproduce the problem to get an idea of where to look.

Sign in to reply to this post

hostmaster336780

try page_more25 that is were the search page is than hit search and you'll see the results page

Sign in to reply to this post

Jason ByrnesWebAssist

you are using a non standard way of creating the site that is causing the issue.


you will need to recode the logic for the next, previous and last links to fit the URL rewriting scheme you are using.


for example, the code for the next link looks like this:

php:
<a href="<?php printf("%s?pageNum_WADAretailchart=%d%s"$currentPagemin($totalPages_WADAretailchart$pageNum_WADAretailchart 1), $queryString_WADAretailchart); ?>" title="Next">




which is generating the following link:
index.php?pageNum_WADAretailchart=2&totalRows_WADAretailchart=1193&S_Brand=&S_RazorNumber=&S_Style=&S_OEMNumbers=&S_Length=&Search.x=53&Search.y=14&Search=Search

to work with your rewriting scheme, the link needs to be:
pageNum_WADAretailchart=2&totalRows_WADAretailchart=1193&S_Brand=&S_RazorNumber=&S_Style=&S_OEMNumbers=&S_Length=&Search.x=53&Search.y=14&Search=Search#!/page_more26


so the link code would need to be:

php:
<a href="<?php printf("?pageNum_WADAretailchart=%d%s",  min($totalPages_WADAretailchart$pageNum_WADAretailchart 1), $queryString_WADAretailchart); ?>#!/page_more26" title="Next">




it looks like your system wants to have the querystring variables first, followed the code to load the certain part of the page


so for the detail page links, change:

php:
<a href="#!/page_more27?RazorNumber=<?php echo(rawurlencode($row_WADAretailchart['RazorNumber'])); ?>" >



to:

php:
<a href="?RazorNumber=<?php echo(rawurlencode($row_WADAretailchart['RazorNumber'])); ?>#!/page_more27" >





the error message you are seeing is caused by having the recordset and Data Assist search code inside the body of the page, this code needs to be before the doctype tag. having it inside the body of the page is causing the headers already sent error message.

Sign in to reply to this post

hostmaster336780

ok I changed the code to what you gave me but now it goes to the details page but the page is blank also can you tell me what lines need to get moved up to the doctype tag to remove the error messages? and there is also code now showing up on the results page... Also i fixed the next buttons but are the other buttons the same code if not can you let me know what they are? and the search results will not show up on ie only on firefox

Sign in to reply to this post

hostmaster336780

is anyone here that can help me more?

Sign in to reply to this post

Jason ByrnesWebAssist

the code that needs to be moved is at lines 1001 - 1150:

php:
<?php require_once('Connections/razorretail.php'); ?>

<?php
//WA Database Search Include
require_once("WADbSearch/HelperPHP.php");
?>
<?php
//WA Database Search (Copyright 2005, WebAssist.com)
//Recordset: WADAretailchart;
//Searchpage: Search.php;
//Form: WADASearchForm;
$WADbSearch1_DefaultWhere "";
if (!
session_id()) session_start();
if ((isset(
$_GET["Search_x"]) && $_GET["Search_x"] != "")) {
  
$WADbSearch1 = new FilterDef;
  
$WADbSearch1->initializeQueryBuilder("MYSQL","1");
  
//keyword array declarations

  //comparison list additions
  
$WADbSearch1->addComparisonFromEdit("Brand","S_Brand","AND","Includes",0);
  
$WADbSearch1->addComparisonFromEdit("RazorNumber","S_RazorNumber","AND","Includes",0);
  
$WADbSearch1->addComparisonFromEdit("Style","S_Style","AND","Includes",0);
  
$WADbSearch1->addComparisonFromEdit("OEMNumbers","S_OEMNumbers","AND","Includes",0);
  
$WADbSearch1->addComparisonFromEdit("Length","S_Length","AND","Includes",0);

  
//save the query in a session variable
  
if (== 1) {
    
$_SESSION["WADbSearch1_Results"]=$WADbSearch1->whereClause;
  }
}
else     {
  
$WADbSearch1 = new FilterDef;
  
$WADbSearch1->initializeQueryBuilder("MYSQL","1");
  
//get the filter definition from a session variable
  
if (== 1)     {
    if (isset(
$_SESSION["WADbSearch1_Results"]) && $_SESSION["WADbSearch1_Results"] != "")     {
      
$WADbSearch1->whereClause $_SESSION["WADbSearch1_Results"];
    }
    else     {
      
$WADbSearch1->whereClause $WADbSearch1_DefaultWhere;
    }
  }
  else     {
    
$WADbSearch1->whereClause $WADbSearch1_DefaultWhere;
  }
}
$WADbSearch1->whereClause str_replace("\\''""''"$WADbSearch1->whereClause);
$WADbSearch1whereClause '';
?>
<?php
if (!function_exists("GetSQLValueString")) {
function 
GetSQLValueString($theValue$theType$theDefinedValue ""$theNotDefinedValue ""
{
  if (
PHP_VERSION 6) {
    
$theValue get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  
$theValue function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch (
$theType) {
    case 
"text":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;    
    case 
"long":
    case 
"int":
      
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case 
"double":
      
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case 
"date":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;
    case 
"defined":
      
$theValue = ($theValue != "") ? $theDefinedValue $theNotDefinedValue;
      break;
  }
  return 
$theValue;
}
}
?>
<?php
$currentPage 
$_SERVER["PHP_SELF"];
?>
<?php
$maxRows_WADAretailchart 
20;
$pageNum_WADAretailchart 0;
if (isset(
$_GET['pageNum_WADAretailchart'])) {
  
$pageNum_WADAretailchart $_GET['pageNum_WADAretailchart'];
}
$startRow_WADAretailchart $pageNum_WADAretailchart $maxRows_WADAretailchart;

mysql_select_db($database_razorretail$razorretail);
$query_WADAretailchart "SELECT Brand, RazorNumber, Style, OEMNumbers, Length, CenterHole, OuterHole, CtoC FROM retailchart";
setQueryBuilderSource($query_WADAretailchart,$WADbSearch1,false);
$query_limit_WADAretailchart sprintf("%s LIMIT %d, %d"$query_WADAretailchart$startRow_WADAretailchart$maxRows_WADAretailchart);
$WADAretailchart mysql_query($query_limit_WADAretailchart$razorretail) or die(mysql_error());
$row_WADAretailchart mysql_fetch_assoc($WADAretailchart);

if (isset(
$_GET['totalRows_WADAretailchart'])) {
  
$totalRows_WADAretailchart $_GET['totalRows_WADAretailchart'];
} else {
  
$all_WADAretailchart mysql_query($query_WADAretailchart);
  
$totalRows_WADAretailchart mysql_num_rows($all_WADAretailchart);
}
$totalPages_WADAretailchart ceil($totalRows_WADAretailchart/$maxRows_WADAretailchart)-1;
?>
<?php
$queryString_WADAretailchart 
"";
if (!empty(
$_SERVER['QUERY_STRING'])) {
  
$params explode("&"$_SERVER['QUERY_STRING']);
  
$newParams = array();
  foreach (
$params as $param) {
    if (
stristr($param"pageNum_WADAretailchart") == false && 
        
stristr($param"totalRows_WADAretailchart") == false) {
      
array_push($newParams$param);
    }
  }
  if (
count($newParams) != 0) {
    
$queryString_WADAretailchart "&" htmlentities(implode("&"$newParams));
  }
}
$queryString_WADAretailchart sprintf("&totalRows_WADAretailchart=%d%s"$totalRows_WADAretailchart$queryString_WADAretailchart);
?>
<?php
//WA AltClass Iterator
class WA_AltClassIterator     {
  var 
$DisplayIndex;
  var 
$DisplayArray;
  
  function 
WA_AltClassIterator($theDisplayArray = array(1)) {
    
$this->ClassCounter 0;
    
$this->ClassArray   $theDisplayArray;
  }
  
  function 
getClass($incrementClass)  {
    if (
sizeof($this->ClassArray) == 0) return "";
      if (
$incrementClass) {
      if (
$this->ClassCounter >= sizeof($this->ClassArray)) $this->ClassCounter 0;
      
$this->ClassCounter++;
    }
    if (
$this->ClassCounter 0)
      return 
$this->ClassArray[$this->ClassCounter-1];
    else
      return 
$this->ClassArray[0];
  }
}
?><?php
//WA Alternating Class
$WARRT_AltClass1 = new WA_AltClassIterator(explode("|""WADAResultsRowDark|"));
?>



i think that code being in the wrong place is part of the reason the details are empty

also, change the link to the details to us:
<a href="?S_RazorNumber=<?php echo(rawurlencode($row_WADAretailchart['RazorNumber'])); ?>&Search.x=53&Search.y=14&Search=Search#!/page_more27" >


the change for the other buttons will be the same change. Here is the original code for the next button:

php:
<a href="<?php printf("%s?pageNum_WADAretailchart=%d%s"$currentPagemin($totalPages_WADAretailchart$pageNum_WADAretailchart 1), $queryString_WADAretailchart); ?>" title="Next">




the changes i made, where to remove the first %s, so:
<?php printf("%s?pageNum....

was changed to:
<?php printf("?pageNum

i then deleted the currentPage variable reference:
$currentPage,

and added #!/page_more26 after the closing php tag, so
...?>" title="Next"...

became"
...?>#!/page_more26" title="Next"...

Sign in to reply to this post

hostmaster336780

the details page is still empty and the error message just moved to the top of the website any more ideas and also the search is still not working in Internet Explorer

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...