Hi I have a script that is working, I then copied it complete to the secure part of my site. When the page opens the full page is exactly the same until I use NEXT Previous when the page refreshes but remains on page One. here is my (shortened)code
<?php
$tenant_detailsid=$_GET['tenant_detailsid'];
$date=$_GET['date'];
$landlordloid=$_GET['landlordloid'];
$first='john';
$last='smith';
$dob='01-09-1987';
$tenant_detailsid='284';
$male=$_GET['male_female'];
$id='id';
include("dbinfo.inc.php");
mysql_connect($host,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
// limit value for number of records to be shown per page
// query database to find total number of records to display
$limit = 5;
$query_count = "select * from ".$prefix."tenant_data WHERE tenant_detailsid='$tenant_detailsid' ORDER by date DESC";
ORDER by date DESC LIMIT 0, 2";
$result_count = mysql_query($query_count);
$totalrows = mysql_num_rows($result_count);
if(empty($page))
$page = 1;
$limitvalue = $page * $limit - ($limit);
$query = "select * from ".$prefix."tenant_data WHERE tenant_detailsid='$tenant_detailsid' ORDER by date DESC LIMIT $limitvalue, $limit ";
$result = mysql_query($query) or die("Error: " . mysql_error());
$count_result = mysql_num_rows($result);
// Display links at the top to indicate current page and number of pages displayed
$numofpages = ceil($totalrows / $limit);
//echo "<br><p><b>$totalrows</b> result(s) for: \"$search\"</p>";
$from=$limit*$page-$limit+1;
$to=$from + $count_result-1;
//---------------------------------
//$query="SELECT * FROM tenant_data WHERE tenant_detailsid='$tenant_detailsid' ORDER by date DESC LIMIT 0, 2";
//$result=mysql_query($query);
//$num=mysql_num_rows($result);
//if ($num==0) {
//$empty = "No Matching";
//}
//else {
//$num_rows = mysql_num_rows($result);
//echo "$num_rows Record Found ";
//}
mysql_close();
?>
<table border="0" cellpadding="0" cellspacing="0" width="800" id="AutoNumber1" >
<tr>
<td width="14%" align="left"><font face='Verdana' size='2' color='#000000'>Tenant Details:</td>
<td width="50%">
<font face='Verdana' size='2' color='#000000'><? echo $first; ?> <? echo $last; ?></td>
</tr>
<tr>
<td width="14%" align="left"><font face='Verdana' size='2' color='#000000'>Date of Birth:</td>
<td width="50%">
<font face='Verdana' size='2' color='#000000'><? echo $dob; ?></td>
</tr>
<tr>
<td width="14%" align="left"><font face='Verdana' size='2' color='#000000'>Tenant No:</td>
<td width="50%">
<font face='Verdana' size='2' color='#000000'><? echo $tenant_detailsid; ?></font> <font face="Verdana" size="1" color="#FF0000"><? echo $totalrows; ?><? echo $empty; ?> RECORDS FOUND</font>
<?
// start 123 next>> table
echo "";if($numofpages>1){echo"<font face='Verdana' size='1' color='#FF0000'>SHOWING: $from - $to";}
?>
<br>
<?
// display previous link if page is not 1
if($page != 1){
$pageprev = $page - 1;
echo("<a href=\"$PHP_SELF?page=$pageprev\"><< PREV</a> ");
}
// display page nos if not 1
for($i = 1; $i <= $numofpages; $i++){
if($numofpages>1){
if($i == $page)
echo("<font face='Verdana' size='1' color='#FF0000'> ".$i." ");
else
echo(" <font face='Verdana' size='1' color='#FF0000'><a href=\"$PHP_SELF?page=$i\">$i</a> </font>");
}}
// display next page link if there is more than one
if(($totalrows - ($limit * $page)) > 0){
$pagenext = $page + 1;
echo(" <a href=\"$PHP_SELF?page=$pagenext\">NEXT >></a>");
}
// end 123 next>> table
//echo "</td></tr></table><br>";
?>
</td>
</tr>
</table>
</table>
<br>
<div align="center">
<td width="700" align="center"><fieldset style="border-color:#FAEFFC"><table cellpadding="0" width="700" bgcolor="#ffffff" cellspacing="0" align="center">
<tr class="headings"><cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
<tr>
<td width="200" align="center"><font face="Verdana" size="2" color="#000000">Date Record Submitted</font></td>
<td width="200" align="center"><font face="Verdana" size="2" color="#000000">Overall Percentage</font></td>
<td width="200" align="center"><font face="Verdana" size="2" color="#000000">County</td>
<td width="200" align="center"><font face="Verdana" size="2" color="#000000">View Full record</td>
</tr>
</table>
<center>
<?
$last = $row["surname"];
$first = $row["firstname"];
$date = $row["date"];
$dob = $row["dob"];
$id = $row["id"];
$county = $row["county"];
$left = $row["leftongoodterms"];
$rent = $row["rentarrears"];
$look = $row["lookedafterproperty"];
$dam = $row["damagecaused"];
$comp = $row["complaintneighbourpolice"];
$diff = $row["difficultyobtainingrent"];
$drugs = $row["drugs"];
$evic = $row["evicted"];
$would = $row["wouldrentagain"];
$break = $row["breakdownsreportedimmediately"];
$brought = $row["broughtownfurniture"];
$bond = $row["bondsupplied"];
$bond2 = $row["bondpaidbydhss"];
$pet = $row["tenanthadpets"];
$sub = $row["tenantsublet"];
$multi = $row["overcrowding"];
$anti = $row["antisocialbehaviour"];
$redec = $row["tenantredecoratedproperty"];
$buis = $row["usedhomeforbuisnesspurposes"];
$other = $row["passedtenancytoother"];
$notice = $row["gavenoticetoendtenancy"];
$date = $row["date"];
$landlordloid = $row["landlordloid"];
//$date = '2006-09-11'; // Assume this came from your database
$ts = mktime(0,0,0,substr($date,5,2),substr($date,8,2),substr($date,0,4)); // Convert to unix format
$formated = date('d-m-Y',$ts);
?>
<font face="Veranda" size="2" color="#000000" align="left">
<table border="0" width="700" height="20" bordercolor="#111111">
<td ><? echo "<input type='hidden' name='$left' value='$left'>";
if ($left == "Yes"){
$pos1 = '4.76';
}
else {
$pos1 = '0';
}
?>
<? echo "<input type='hidden' name='$drugs' value='$drugs'>";
if ($notice == "Yes"){
$pos20 = '4.76';
}
else {
$pos20 = '0';
}
if ($total !=1) {
$percentage =$pos21+$pos20+$pos19+$pos18+$pos17+$pos16+$pos15+$pos14+$pos13+$pos12+$pos11+$pos10+$pos9+$pos8+$pos7+$pos6+$pos5+$pos4+$pos3+$pos2+$pos1;
}
else {
}
?>
</td>
<td><? echo "<td width='170' align='center' bgcolor=$bg_color>$formated"; ?></td>
<td><? echo "<td width='170' align='center' bgcolor=$bg_color>";
if ($percentage >= 87.5) {
$color = '#00FF00';
} elseif ($percentage >= 37.5) {
$color = '#ff9900';
} else {
$color = 'red';
}
echo '<b style="color:' . $color . '">' . $percentage . ' %</b>';
?> </td>
<td><? echo "<td width='250' bgcolor=$bg_color align='center'>$county</td>"; ?></td>
<form action="fullrecord1.php" method="get">
<td><input type="hidden" size="150" value="<? echo $id; ?>" name="id"><? echo "<td bgcolor=$bg_color align='center'><input type='submit' value='View Full Record'></td>"; ?>
</form>
</tr>
<?
$i++;
}
echo "</table>";
?>
Any suggestions would be agreat help,
cheers
rosscor