/ Forside / Teknologi / Udvikling / PHP / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
PHP
#NavnPoint
rfh 3959
natmaden 3372
poul_from 3310
funbreak 2700
stone47 2230
Jin2k 1960
Angband 1743
Bjerner 1249
refi 1185
10  Interkril.. 1146
next-link duer ikke
Fra : Knud Haugmark


Dato : 25-11-07 17:40

Jeg bruger Dreamweaver til at lave php sider med - og det går rigtig godt -
bortset fra en ny side med en search-form med 6 parametre. Resultatsiden
(som er den samme, men det hjælper ikke at oprette en anden) viser de første
50 records og så klikker man til side to med en "next" link, som DW har
lavet via sin records paging funktion. Men det virker ikke og jeg får fejl,
det ser ud til at variablerne ikke kommer med, og så går sql commandoen i
ged.
prøv det evt her og kom gerne med erfaringer. Det er dw cs.
http://www.sickpigs.dk/brak/brakbase.php

Knud



 
 
Dan Storm (26-11-2007)
Kommentar
Fra : Dan Storm


Dato : 26-11-07 09:47

Knud Haugmark skrev:
> Jeg bruger Dreamweaver til at lave php sider med - og det går rigtig
> godt - bortset fra en ny side med en search-form med 6 parametre.
> Resultatsiden (som er den samme, men det hjælper ikke at oprette en
> anden) viser de første 50 records og så klikker man til side to med en
> "next" link, som DW har lavet via sin records paging funktion. Men det
> virker ikke og jeg får fejl, det ser ud til at variablerne ikke kommer
> med, og så går sql commandoen i ged.
> prøv det evt her og kom gerne med erfaringer. Det er dw cs.
> http://www.sickpigs.dk/brak/brakbase.php

Vi bliver nød til at se noget kildekode for at kunne hjælpe dig.

--
Dan Storm - storm at err0r dot dk / http://err0r.dk

Tro ikke brugerne vil gøre noget for at undgå dit killfilter
- Så vigtig er du heller ikke!

Knud Haugmark (26-11-2007)
Kommentar
Fra : Knud Haugmark


Dato : 26-11-07 21:34

OK her er sidens kildekode.
Tak fordi I gider kigge på den.

<?php require_once('../Connections/sickpigs.php'); ?>
<?php require_once('../Connections/sickpigs.php'); ?>
<?php
if(!isset($arealmindst))
{
$arealmindst=-1;
}

if(!isset($arealstorst))
{
$arealstorst=0.1;
}

if(!isset($brakover))
{
$brakover=0.5;
}
if(!isset($brakunder))
{
$brakunder=-1;
}
if(!isset($brakpctover))
{
$brakpctover=-1;
}
if(!isset($brakpctunder))
{
$brakpctunder=-1;
}
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "",
$theNotDefinedValue = "")
{
$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;
}
}

if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "",
$theNotDefinedValue = "")
{
$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;
}
}

$currentPage = $_SERVER["PHP_SELF"];

$maxRows_Recordset1 = 50;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;

mysql_select_db($database_sickpigs, $sickpigs);
$query_Recordset1 = "SELECT * FROM brak WHERE ( brak.areal >=$arealmindst OR
$arealmindst = -1) AND (brak.areal <= $arealstorst OR $arealstorst = -1) AND
( brak.brakareal >=$brakover OR $brakover = -1) AND (brak.brakareal <=
$brakunder OR $brakunder = -1)AND ( brak.brakprocent >=$brakpctover OR
$brakpctover = -1) AND (brak.brakprocent <= $brakpctunder OR $brakpctunder
= -1) ORDER BY brak.brakprocent, brak.brakareal";
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1,
$startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $sickpigs) or
die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);

if (isset($_GET['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;

/*$colname_sum_brakareal = "-1";
if (isset($_POST['brakareal'])) {
$colname_sum_brakareal = $_POST['brakareal'];
}
mysql_select_db($database_sickpigs, $sickpigs);
$query_sum_brakareal = sprintf("SELECT SUM ('brakareal') as totalbrak FROM
brak WHERE brakareal > %s", GetSQLValueString($colname_sum_brakareal,
"double"));
$sum_brakareal = mysql_query($query_sum_brakareal, $sickpigs) or
die(mysql_error());
$row_sum_brakareal = mysql_fetch_assoc($sum_brakareal);
$totalRows_sum_brakareal = mysql_num_rows($sum_brakareal);*/

$colname_totalprice = "-1";
if (isset($_POST['brakareal'])) {
$colname_totalprice = $_POST['brakareal'];
}
mysql_select_db($database_sickpigs, $sickpigs);
$query_totalprice = sprintf("SELECT SUM( `brakareal` ) as totalbrak
FROM `brak`
WHERE ( brak.areal >=$arealmindst OR $arealmindst = -1) AND (brak.areal <=
$arealstorst OR $arealstorst = -1) AND ( brak.brakareal >=$brakover OR
$brakover = -1) AND (brak.brakareal <= $brakunder OR $brakunder = -1)AND (
brak.brakprocent >=$brakpctover OR $brakpctover = -1) AND (brak.brakprocent
<= $brakpctunder OR $brakpctunder = -1) ",
GetSQLValueString($colname_totalprice, "double")
);
$totalprice = mysql_query($query_totalprice, $sickpigs) or
die(mysql_error());
$row_totalprice = mysql_fetch_assoc($totalprice);
$totalRows_totalprice = mysql_num_rows($totalprice);


$queryString_Recordset1 = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_Recordset1") == false &&
stristr($param, "totalRows_Recordset1") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_Recordset1 = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s",
$totalRows_Recordset1, $queryString_Recordset1);


?><!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Søgning i brakarealer</title>
<link href="../gyllestyles.css" rel="stylesheet" type="text/css" />
<script language='JavaScript' type='text/javascript'
src='JScript/formValidator.js'></script>
<script>
function validateform1(formNode){
var formValidatorInstance = new FormValidator(formNode);
formValidatorInstance.addRule('arealmindst','husk','required');
return formValidatorInstance.validate();
}
</script>
</head>

<body>
<p>Markblokke med brakarealer i postnumrene 3000-3999</p>
<form action="display_all.php" method="post" name="form1" id="form1"
onsubmit="return validateform1(this)">
<table width="407" border="1" cellpadding="3" cellspacing="0"
bordercolor="#9EACCB" bgcolor="#DCDEE4">
<tr>
<td colspan="8" bgcolor="#5B7195" class="stottestyle1"><font
face="Arial">Find markblok med brak</font></td>
</tr>
<tr>
<td width="127" bgcolor="#5B7195" class="stottestyle2"><font
face="Arial">Aareal over (ha)</font></td>
<td width="102" class="tdstyle"><font face="Arial">
<select name="arealmindst" size="1" id="arealmindst" tabindex="4">
<option value="-1" <?php if (!(strcmp(-1, $arealmindst))) {echo
"selected=\"selected\"";} ?>>Ingen nedre grænse</option>
<option value="0.1" <?php if (!(strcmp(0.1, $arealmindst))) {echo
"selected=\"selected\"";} ?>>0.1</option>
<option value="0.2" <?php if (!(strcmp(0.2, $arealmindst))) {echo
"selected=\"selected\"";} ?>>0.2</option>
<option value="0.3" <?php if (!(strcmp(0.3, $arealmindst))) {echo
"selected=\"selected\"";} ?>>0.3</option>
<option value="0.5" <?php if (!(strcmp(0.5, $arealmindst))) {echo
"selected=\"selected\"";} ?>>0.5</option>
<option value="0.7" <?php if (!(strcmp(0.7, $arealmindst))) {echo
"selected=\"selected\"";} ?>>0.7</option>
<option value="1.0" <?php if (!(strcmp(1.0, $arealmindst))) {echo
"selected=\"selected\"";} ?>>1.0</option>
<option value="1.5" <?php if (!(strcmp(1.5, $arealmindst))) {echo
"selected=\"selected\"";} ?>>1.5</option>
<option value="2.0" <?php if (!(strcmp(2.0, $arealmindst))) {echo
"selected=\"selected\"";} ?>>2.0</option>
<option value="2.5" <?php if (!(strcmp(2.5, $arealmindst))) {echo
"selected=\"selected\"";} ?>>2.5</option>
<option value="3.0" <?php if (!(strcmp(3.0, $arealmindst))) {echo
"selected=\"selected\"";} ?>>3.0</option>
<option value="5.0" <?php if (!(strcmp(5.0, $arealmindst))) {echo
"selected=\"selected\"";} ?>>5.0</option>
<option value="10.0" <?php if (!(strcmp(10.0, $arealmindst)))
{echo "selected=\"selected\"";} ?>>10</option>
<option value="15.0" <?php if (!(strcmp(15.0, $arealmindst)))
{echo "selected=\"selected\"";} ?>>15</option>
<option value="20.0" <?php if (!(strcmp(20.0, $arealmindst)))
{echo "selected=\"selected\"";} ?>>20</option>
<option value="25.0" <?php if (!(strcmp(25.0, $arealmindst)))
{echo "selected=\"selected\"";} ?>>25</option>
<option value="30.0" <?php if (!(strcmp(30.0, $arealmindst)))
{echo "selected=\"selected\"";} ?>>30</option>
<option value="35.0" <?php if (!(strcmp(35.0, $arealmindst)))
{echo "selected=\"selected\"";} ?>>35</option>
<option value="40.0" <?php if (!(strcmp(40.0, $arealmindst)))
{echo "selected=\"selected\"";} ?>>40</option>
<option value="50.0" <?php if (!(strcmp(50.0, $arealmindst)))
{echo "selected=\"selected\"";} ?>>50</option>
<option value="60.0" <?php if (!(strcmp(60.0, $arealmindst)))
{echo "selected=\"selected\"";} ?>>60</option>
<option value="70.0" <?php if (!(strcmp(70.0, $arealmindst)))
{echo "selected=\"selected\"";} ?>>70</option>
<option value="80.0" <?php if (!(strcmp(80.0, $arealmindst)))
{echo "selected=\"selected\"";} ?>>80</option>
<option value="90.0" <?php if (!(strcmp(90.0, $arealmindst)))
{echo "selected=\"selected\"";} ?>>90</option>
<option value="100.0" <?php if (!(strcmp(100.0, $arealmindst)))
{echo "selected=\"selected\"";} ?>>100</option>
<option value="120.0" <?php if (!(strcmp(120.0, $arealmindst)))
{echo "selected=\"selected\"";} ?>>120</option>
<option value="130.0" <?php if (!(strcmp(130.0, $arealmindst)))
{echo "selected=\"selected\"";} ?>>130</option>
<option value="150.0" <?php if (!(strcmp(150.0, $arealmindst)))
{echo "selected=\"selected\"";} ?>>150</option>
<option value="170.0" <?php if (!(strcmp(170.0, $arealmindst)))
{echo "selected=\"selected\"";} ?>>170</option>
<option value="190.0" <?php if (!(strcmp(190.0, $arealmindst))) {echo
"selected=\"selected\"";} ?>>190</option>
</select>
</font></td>
<td width="43" bgcolor="#5B7195" class="stottestyle2"><p>Areal under
(ha)</p></td>
<td width="101" align="right" class="tdstyle"><label><font
face="Arial">
<select name="arealstorst" size="1" id="arealstorst" tabindex="5">
<option value="-1" <?php if (!(strcmp(-1, $arealstorst))) {echo
"selected=\"selected\"";} ?>>Ingen øvre grænse</option>
<option value="0.1" <?php if (!(strcmp(0.1, $arealstorst))) {echo
"selected=\"selected\"";} ?>>0.1</option>
<option value="0.2" <?php if (!(strcmp(0.2, $arealstorst))) {echo
"selected=\"selected\"";} ?>>0.2</option>
<option value="0.3" <?php if (!(strcmp(0.3, $arealstorst))) {echo
"selected=\"selected\"";} ?>>0.3</option>
<option value="0.5" <?php if (!(strcmp(0.5, $arealstorst))) {echo
"selected=\"selected\"";} ?>>0.5</option>
<option value="0.7" <?php if (!(strcmp(0.7, $arealstorst))) {echo
"selected=\"selected\"";} ?>>0.7</option>
<option value="1.0" <?php if (!(strcmp(1.0, $arealstorst))) {echo
"selected=\"selected\"";} ?>>1.0</option>
<option value="1.5" <?php if (!(strcmp(1.5, $arealstorst))) {echo
"selected=\"selected\"";} ?>>1.5</option>
<option value="2.0" <?php if (!(strcmp(2.0, $arealstorst))) {echo
"selected=\"selected\"";} ?>>2.0</option>
<option value="2.5" <?php if (!(strcmp(2.5, $arealstorst))) {echo
"selected=\"selected\"";} ?>>2.5</option>
<option value="3.0" <?php if (!(strcmp(3.0, $arealstorst))) {echo
"selected=\"selected\"";} ?>>3.0</option>
<option value="5.0" <?php if (!(strcmp(5.0, $arealstorst))) {echo
"selected=\"selected\"";} ?>>5.0</option>
<option value="10" <?php if (!(strcmp(10, $arealstorst))) {echo
"selected=\"selected\"";} ?>>10</option>
<option value="15" <?php if (!(strcmp(15, $arealstorst))) {echo
"selected=\"selected\"";} ?>>15</option>
<option value="20" <?php if (!(strcmp(20, $arealstorst))) {echo
"selected=\"selected\"";} ?>>20</option>
<option value="25" <?php if (!(strcmp(25, $arealstorst))) {echo
"selected=\"selected\"";} ?>>25</option>
<option value="30" <?php if (!(strcmp(30, $arealstorst))) {echo
"selected=\"selected\"";} ?>>30</option>
<option value="35" <?php if (!(strcmp(35, $arealstorst))) {echo
"selected=\"selected\"";} ?>>35</option>
<option value="40" <?php if (!(strcmp(40, $arealstorst))) {echo
"selected=\"selected\"";} ?>>40</option>
<option value="50" <?php if (!(strcmp(50, $arealstorst))) {echo
"selected=\"selected\"";} ?>>50</option>
<option value="60" <?php if (!(strcmp(60, $arealstorst))) {echo
"selected=\"selected\"";} ?>>60</option>
<option value="70" <?php if (!(strcmp(70, $arealstorst))) {echo
"selected=\"selected\"";} ?>>70</option>
<option value="80" <?php if (!(strcmp(80, $arealstorst))) {echo
"selected=\"selected\"";} ?>>80</option>
<option value="90" <?php if (!(strcmp(90, $arealstorst))) {echo
"selected=\"selected\"";} ?>>90</option>
<option value="100" <?php if (!(strcmp(100, $arealstorst))) {echo
"selected=\"selected\"";} ?>>100</option>
<option value="120" <?php if (!(strcmp(120, $arealstorst))) {echo
"selected=\"selected\"";} ?>>120</option>
<option value="130" <?php if (!(strcmp(130, $arealstorst))) {echo
"selected=\"selected\"";} ?>>130</option>
<option value="150" <?php if (!(strcmp(150, $arealstorst))) {echo
"selected=\"selected\"";} ?>>150</option>
<option value="170" <?php if (!(strcmp(170, $arealstorst))) {echo
"selected=\"selected\"";} ?>>170</option>
<option value="190" <?php if (!(strcmp(190, $arealstorst))) {echo
"selected=\"selected\"";} ?>>190</option>
</select>
</font></label></td>
<td width="101" align="right" class="tdstyle">&nbsp;</td>
<td width="101" align="right" class="tdstyle">&nbsp;</td>
<td width="101" align="right" class="tdstyle">&nbsp;</td>
<td width="101" align="right" class="tdstyle">&nbsp;</td>
</tr>
<tr>
<td bgcolor="#5B7195" class="stottestyle2"><span
class="tdstyle">Brakareal over (ha)</span></td>
<td class="tdstyle"><span class="stottestyle2"><font face="Arial">
<select name="brakover" size="1" id="brakover" tabindex="4">
<option value="-1" <?php if (!(strcmp(-1, $brakover))) {echo
"selected=\"selected\"";} ?>>Ingen nedre grænse</option>
<option value="0.1" <?php if (!(strcmp(0.1, $brakover))) {echo
"selected=\"selected\"";} ?>>0.1</option>
<option value="0.2" <?php if (!(strcmp(0.2, $brakover))) {echo
"selected=\"selected\"";} ?>>0.2</option>
<option value="0.3" <?php if (!(strcmp(0.3, $brakover))) {echo
"selected=\"selected\"";} ?>>0.3</option>
<option value="0.5" <?php if (!(strcmp(0.5, $brakover))) {echo
"selected=\"selected\"";} ?>>0.5</option>
<option value="0.7" <?php if (!(strcmp(0.7, $brakover))) {echo
"selected=\"selected\"";} ?>>0.7</option>
<option value="1.0" <?php if (!(strcmp(1.0, $brakover))) {echo
"selected=\"selected\"";} ?>>1.0</option>
<option value="1.5" <?php if (!(strcmp(1.5, $brakover))) {echo
"selected=\"selected\"";} ?>>1.5</option>
<option value="2.0" <?php if (!(strcmp(2.0, $brakover))) {echo
"selected=\"selected\"";} ?>>2.0</option>
<option value="2.5" <?php if (!(strcmp(2.5, $brakover))) {echo
"selected=\"selected\"";} ?>>2.5</option>
<option value="3.0" <?php if (!(strcmp(3.0, $brakover))) {echo
"selected=\"selected\"";} ?>>3.0</option>
<option value="5.0" <?php if (!(strcmp(5.0, $brakover))) {echo
"selected=\"selected\"";} ?>>5.0</option>
<option value="10" <?php if (!(strcmp(10, $brakover))) {echo
"selected=\"selected\"";} ?>>10</option>
<option value="15" <?php if (!(strcmp(15, $brakover))) {echo
"selected=\"selected\"";} ?>>15</option>
<option value="20" <?php if (!(strcmp(20, $brakover))) {echo
"selected=\"selected\"";} ?>>20</option>
<option value="25" <?php if (!(strcmp(25, $brakover))) {echo
"selected=\"selected\"";} ?>>25</option>
<option value="30" <?php if (!(strcmp(30, $brakover))) {echo
"selected=\"selected\"";} ?>>30</option>
<option value="35" <?php if (!(strcmp(35, $brakover))) {echo
"selected=\"selected\"";} ?>>35</option>
<option value="40" <?php if (!(strcmp(40, $brakover))) {echo
"selected=\"selected\"";} ?>>40</option>
<option value="50" <?php if (!(strcmp(50, $brakover))) {echo
"selected=\"selected\"";} ?>>50</option>
<option value="60" <?php if (!(strcmp(60, $brakover))) {echo
"selected=\"selected\"";} ?>>60</option>
<option value="70" <?php if (!(strcmp(70, $brakover))) {echo
"selected=\"selected\"";} ?>>70</option>
<option value="80" <?php if (!(strcmp(80, $brakover))) {echo
"selected=\"selected\"";} ?>>80</option>
<option value="90" <?php if (!(strcmp(90, $brakover))) {echo
"selected=\"selected\"";} ?>>90</option>
<option value="100" <?php if (!(strcmp(100, $brakover))) {echo
"selected=\"selected\"";} ?>>100</option>
<option value="120" <?php if (!(strcmp(120, $brakover))) {echo
"selected=\"selected\"";} ?>>120</option>
<option value="130" <?php if (!(strcmp(130, $brakover))) {echo
"selected=\"selected\"";} ?>>130</option>
<option value="150" <?php if (!(strcmp(150, $brakover))) {echo
"selected=\"selected\"";} ?>>150</option>
<option value="170" <?php if (!(strcmp(170, $brakover))) {echo
"selected=\"selected\"";} ?>>170</option>
<option value="190" <?php if (!(strcmp(190, $brakover))) {echo
"selected=\"selected\"";} ?>>190</option>
</select>
</font></span></td>
<td bgcolor="#5B7195" class="stottestyle2"><span
class="tdstyle">Brakareal under (ha)</span></td>
<td align="right" class="tdstyle"><label><font face="Arial"><font
face="Arial"><font face="Arial"><font face="Arial">
<select name="brakunder" size="1" id="brakunder" tabindex="4">
<option value="-1">Ingen øvre grænse</option>
<option value="0.1">0.1</option>
<option value="0.2">0.2</option>
<option value="0.3">0.3</option>
<option value="0.5">0.5</option>
<option value="0.7">0.7</option>
<option value="1.0">1.0</option>
<option value="1.5">1.5</option>
<option value="2.0">2.0</option>
<option value="2.5">2.5</option>
<option value="3.0">3.0</option>
<option value="5.0">5.0</option>
<option value="10.0">10</option>
<option value="15.0">15</option>
<option value="20.0">20</option>
<option value="25.0">25</option>
<option value="30.0">30</option>
<option value="35.0">35</option>
<option value="40.0">40</option>
<option value="50.0">50</option>
<option value="60.0">60</option>
<option value="70.0">70</option>
<option value="80.0">80</option>
<option value="90.0">90</option>
<option value="100.0">100</option>
<option value="120.0">120</option>
<option value="130.0">130</option>
<option value="150.0">150</option>
<option value="170.0">170</option>
<option value="190.0">190</option>
<option value="&lt;200">Over 200</option>
</select>
</font></font></font></font></label></td>
<td align="right" class="tdstyle">&nbsp;</td>
<td align="right" class="tdstyle">&nbsp;</td>
<td align="right" class="tdstyle">&nbsp;</td>
<td align="right" class="tdstyle">&nbsp;</td>
</tr>
<tr>
<td bgcolor="#5B7195" class="stottestyle2">Brakprocent over</td>
<td class="tdstyle"><label>
<select name="brakpctover" id="brakpctover">
<option value="-1">Ingen nedre grænse</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="5">5</option>
<option value="7">7</option>
<option value="10">10</option>
<option value="15">15</option>
<option value="20">20</option>
<option value="25">25</option>
<option value="30">30</option>
<option value="40">40</option>
<option value="50">50</option>
<option value="60">60</option>
<option value="70">70</option>
<option value="80">80</option>
<option value="90">90</option>
<option value="100">100</option>
<option value="&gt;100">Over 100</option>
</select>
</label></td>
<td class="stottestyle2">Brakprocent under</td>
<td class="tdstyle"><select name="brakpctunder" id="brakpctunder">
<option value="-1">Ingen øvre grænse</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="5">5</option>
<option value="7">7</option>
<option value="10">10</option>
<option value="15">15</option>
<option value="20">20</option>
<option value="25">25</option>
<option value="30">30</option>
<option value="40">40</option>
<option value="50">50</option>
<option value="60">60</option>
<option value="70">70</option>
<option value="80">80</option>
<option value="90">90</option>
<option value="100">100</option>
<option value="&gt;100">Over 100</option>
</select></td>
<td class="tdstyle">&nbsp;</td>
<td class="tdstyle">&nbsp;</td>
<td class="tdstyle">&nbsp;</td>
<td class="tdstyle">&nbsp;</td>
</tr>
<tr>
<td colspan="8" class="tdstyle"><div align="right"><font face="Arial">
<input type="submit" name="submit" value="search"tabindex="11" />
</font></div></td>
</tr>
</table>
</form>


<?php if ($totalRows_Recordset1 == 0) { // Show if recordset empty ?>
<p>Ingen markblokke fundet.<br />
Fremsøg markblokke ved at indtaste kriterier i skemaet ovenfor. </p>
<?php } // Show if recordset empty ?>
<?php if ($totalRows_Recordset1 > 0) { // Show if recordset not empty ?>
Du har søgt markblokke hvor:
<p> <?php

function variableset ($var1,$var2)
{
if ($var1 > 0)
{
echo $var2. " ha.";
}
}
function variableset2 ($var1,$var2)
{
if ($var1 > 0)
{
echo $var2. " %.";
}
}
variableset ($arealmindst,"Mindste areal er ". $arealmindst);
variableset($arealstorst,"<br> Største areal er: ".$arealstorst);
variableset($brakover,"<br> Brakarealet er over: ".$brakover);
variableset($brakunder,"<br> Brakarealer er under: ". $brakunder);
variableset2($brakpctunder,"<br> Brakprocenten er under: ". $brakpctunder);
variableset2($brakpctover,"<br> Brakprocenten er over: ". $brakpctover);
?>

&nbsp;</p>
<p>Der er i ialt <?php echo $totalRows_Recordset1 ?> markblokke, der
svarer til dine søgekriterier.

<?php if( $totalRows_Recordset1 > 6000)
{
echo "Der er over 6000 markblokke, der svarer til dine søgekriterier. Det er
for mange, indskrænk derfor dine søgekriterier";
exit;
}
?></p>
<p>Søgningens samlede brakareal udgør <?php echo
$row_totalprice['totalbrak']; ?> ha.</p>
<div align="center"></div>
<p align="center">
<table border="1" cellpadding="3">
<tr class="stottestyle1">
<td><div align="center">Markbloknr</div></td>
<td><div align="center">Blokkens areal</div></td>
<td><div align="center">Brakareal</div></td>
<td><div align="center">Special_brak</div></td>
<td><div align="center">Brakprocent</div></td>
</tr>
<?php do { ?>
<tr class="stottestyle2">
<td><div align="right"><?php echo $row_Recordset1['bloknr'];
?></div></td>
<td><div align="right"><?php echo $row_Recordset1['areal'];
?></div></td>
<td><div align="right"><?php echo $row_Recordset1['brakareal'];
?></div></td>
<td><div align="right"><?php echo $row_Recordset1['special_brak'];
?></div></td>
<td><div align="right"><?php echo $row_Recordset1['brakprocent'];
?></div></td>
</tr>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</table>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage,
min($totalPages_Recordset1, $pageNum_Recordset1 + 1),
$queryString_Recordset1); ?>">Next</a><br />
<?php } // Show if recordset not empty ?>
</body>
</html>
<?php

mysql_free_result($Recordset1);

mysql_free_result($totalprice);
?>

"Dan Storm" <shadyz@_REMOVETHIS_err0r.dk> skrev i meddelelsen
news:474a880f$0$15897$edfadb0f@dtext01.news.tele.dk...
> Knud Haugmark skrev:
>> Jeg bruger Dreamweaver til at lave php sider med - og det går rigtig
>> godt - bortset fra en ny side med en search-form med 6 parametre.
>> Resultatsiden (som er den samme, men det hjælper ikke at oprette en
>> anden) viser de første 50 records og så klikker man til side to med en
>> "next" link, som DW har lavet via sin records paging funktion. Men det
>> virker ikke og jeg får fejl, det ser ud til at variablerne ikke kommer
>> med, og så går sql commandoen i ged.
>> prøv det evt her og kom gerne med erfaringer. Det er dw cs.
>> http://www.sickpigs.dk/brak/brakbase.php
>
> Vi bliver nød til at se noget kildekode for at kunne hjælpe dig.
>
> --
> Dan Storm - storm at err0r dot dk / http://err0r.dk
>
> Tro ikke brugerne vil gøre noget for at undgå dit killfilter
> - Så vigtig er du heller ikke!


Dan Storm (27-11-2007)
Kommentar
Fra : Dan Storm


Dato : 27-11-07 10:01

Knud Haugmark skrev:
> OK her er sidens kildekode.
> Tak fordi I gider kigge på den.

Det er slet ikke muligt for mig at få et søgeresultat frem således jeg
kan finde dit paging element. Hver eneste gang jeg trykker søg, får jeg
meldingen:

Ingen markblokke fundet.
Fremsøg markblokke ved at indtaste kriterier i skemaet ovenfor.

--
Dan Storm - storm at err0r dot dk / http://err0r.dk

Tro ikke brugerne vil gøre noget for at undgå dit killfilter
- Så vigtig er du heller ikke!

Knud Haugmark (27-11-2007)
Kommentar
Fra : Knud Haugmark


Dato : 27-11-07 21:02

Prøv bare at nulstille alle felter undtagen "areal under", som sættes til
1.0. Så skulle det lykkes:
http://www.sickpigs.dk/brak/brakbase.php
Største areal er: 1.0 ha.

Der er i ialt 5413 markblokke, der svarer til dine søgekriterier.

Søgningens samlede brakareal udgør 2794.71 ha.


Knud

"Dan Storm" <shadyz@_REMOVETHIS_err0r.dk> skrev i meddelelsen
news:474bdce6$0$15897$edfadb0f@dtext01.news.tele.dk...
> Knud Haugmark skrev:
> > OK her er sidens kildekode.
> > Tak fordi I gider kigge på den.
>
> Det er slet ikke muligt for mig at få et søgeresultat frem således jeg
> kan finde dit paging element. Hver eneste gang jeg trykker søg, får jeg
> meldingen:
>
> Ingen markblokke fundet.
> Fremsøg markblokke ved at indtaste kriterier i skemaet ovenfor.
>
> --
> Dan Storm - storm at err0r dot dk / http://err0r.dk
>
> Tro ikke brugerne vil gøre noget for at undgå dit killfilter
> - Så vigtig er du heller ikke!


Knud Haugmark (27-11-2007)
Kommentar
Fra : Knud Haugmark


Dato : 27-11-07 21:04

Måske er det nemmere at se problemet her, hvor der er en særlig resultatside
kaldet display_all.php
http://www.sickpigs.dk/brak/

Knud
"Knud Haugmark" <knud@haugmark.dk> skrev i meddelelsen
news:474b2dbc$0$21932$157c6196@dreader1.cybercity.dk...
> OK her er sidens kildekode.
> Tak fordi I gider kigge på den.
>
> <?php require_once('../Connections/sickpigs.php'); ?>
> <?php require_once('../Connections/sickpigs.php'); ?>
> <?php
> if(!isset($arealmindst))
> {
> $arealmindst=-1;
> }
>
> if(!isset($arealstorst))
> {
> $arealstorst=0.1;
> }
>
> if(!isset($brakover))
> {
> $brakover=0.5;
> }
> if(!isset($brakunder))
> {
> $brakunder=-1;
> }
> if(!isset($brakpctover))
> {
> $brakpctover=-1;
> }
> if(!isset($brakpctunder))
> {
> $brakpctunder=-1;
> }
> if (!function_exists("GetSQLValueString")) {
> function GetSQLValueString($theValue, $theType, $theDefinedValue = "",
> $theNotDefinedValue = "")
> {
> $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;
> }
> }
>
> if (!function_exists("GetSQLValueString")) {
> function GetSQLValueString($theValue, $theType, $theDefinedValue = "",
> $theNotDefinedValue = "")
> {
> $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;
> }
> }
>
> $currentPage = $_SERVER["PHP_SELF"];
>
> $maxRows_Recordset1 = 50;
> $pageNum_Recordset1 = 0;
> if (isset($_GET['pageNum_Recordset1'])) {
> $pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
> }
> $startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
>
> mysql_select_db($database_sickpigs, $sickpigs);
> $query_Recordset1 = "SELECT * FROM brak WHERE ( brak.areal >=$arealmindst
> OR $arealmindst = -1) AND (brak.areal <= $arealstorst OR $arealstorst
> = -1) AND ( brak.brakareal >=$brakover OR $brakover = -1) AND
> (brak.brakareal <= $brakunder OR $brakunder = -1)AND ( brak.brakprocent
> >=$brakpctover OR $brakpctover = -1) AND (brak.brakprocent <=
> $brakpctunder OR $brakpctunder = -1) ORDER BY brak.brakprocent,
> brak.brakareal";
> $query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1,
> $startRow_Recordset1, $maxRows_Recordset1);
> $Recordset1 = mysql_query($query_limit_Recordset1, $sickpigs) or
> die(mysql_error());
> $row_Recordset1 = mysql_fetch_assoc($Recordset1);
>
> if (isset($_GET['totalRows_Recordset1'])) {
> $totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
> } else {
> $all_Recordset1 = mysql_query($query_Recordset1);
> $totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
> }
> $totalPages_Recordset1 =
> ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
>
> /*$colname_sum_brakareal = "-1";
> if (isset($_POST['brakareal'])) {
> $colname_sum_brakareal = $_POST['brakareal'];
> }
> mysql_select_db($database_sickpigs, $sickpigs);
> $query_sum_brakareal = sprintf("SELECT SUM ('brakareal') as totalbrak FROM
> brak WHERE brakareal > %s", GetSQLValueString($colname_sum_brakareal,
> "double"));
> $sum_brakareal = mysql_query($query_sum_brakareal, $sickpigs) or
> die(mysql_error());
> $row_sum_brakareal = mysql_fetch_assoc($sum_brakareal);
> $totalRows_sum_brakareal = mysql_num_rows($sum_brakareal);*/
>
> $colname_totalprice = "-1";
> if (isset($_POST['brakareal'])) {
> $colname_totalprice = $_POST['brakareal'];
> }
> mysql_select_db($database_sickpigs, $sickpigs);
> $query_totalprice = sprintf("SELECT SUM( `brakareal` ) as totalbrak
> FROM `brak`
> WHERE ( brak.areal >=$arealmindst OR $arealmindst = -1) AND (brak.areal <=
> $arealstorst OR $arealstorst = -1) AND ( brak.brakareal >=$brakover OR
> $brakover = -1) AND (brak.brakareal <= $brakunder OR $brakunder = -1)AND
> ( brak.brakprocent >=$brakpctover OR $brakpctover = -1) AND
> (brak.brakprocent <= $brakpctunder OR $brakpctunder = -1) ",
> GetSQLValueString($colname_totalprice, "double")
> );
> $totalprice = mysql_query($query_totalprice, $sickpigs) or
> die(mysql_error());
> $row_totalprice = mysql_fetch_assoc($totalprice);
> $totalRows_totalprice = mysql_num_rows($totalprice);
>
>
> $queryString_Recordset1 = "";
> if (!empty($_SERVER['QUERY_STRING'])) {
> $params = explode("&", $_SERVER['QUERY_STRING']);
> $newParams = array();
> foreach ($params as $param) {
> if (stristr($param, "pageNum_Recordset1") == false &&
> stristr($param, "totalRows_Recordset1") == false) {
> array_push($newParams, $param);
> }
> }
> if (count($newParams) != 0) {
> $queryString_Recordset1 = "&" . htmlentities(implode("&", $newParams));
> }
> }
> $queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s",
> $totalRows_Recordset1, $queryString_Recordset1);
>
>
> ?><!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>
> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
> <title>Søgning i brakarealer</title>
> <link href="../gyllestyles.css" rel="stylesheet" type="text/css" />
> <script language='JavaScript' type='text/javascript'
> src='JScript/formValidator.js'></script>
> <script>
> function validateform1(formNode){
> var formValidatorInstance = new FormValidator(formNode);
> formValidatorInstance.addRule('arealmindst','husk','required');
> return formValidatorInstance.validate();
> }
> </script>
> </head>
>
> <body>
> <p>Markblokke med brakarealer i postnumrene 3000-3999</p>
> <form action="display_all.php" method="post" name="form1" id="form1"
> onsubmit="return validateform1(this)">
> <table width="407" border="1" cellpadding="3" cellspacing="0"
> bordercolor="#9EACCB" bgcolor="#DCDEE4">
> <tr>
> <td colspan="8" bgcolor="#5B7195" class="stottestyle1"><font
> face="Arial">Find markblok med brak</font></td>
> </tr>
> <tr>
> <td width="127" bgcolor="#5B7195" class="stottestyle2"><font
> face="Arial">Aareal over (ha)</font></td>
> <td width="102" class="tdstyle"><font face="Arial">
> <select name="arealmindst" size="1" id="arealmindst" tabindex="4">
> <option value="-1" <?php if (!(strcmp(-1, $arealmindst))) {echo
> "selected=\"selected\"";} ?>>Ingen nedre grænse</option>
> <option value="0.1" <?php if (!(strcmp(0.1, $arealmindst))) {echo
> "selected=\"selected\"";} ?>>0.1</option>
> <option value="0.2" <?php if (!(strcmp(0.2, $arealmindst))) {echo
> "selected=\"selected\"";} ?>>0.2</option>
> <option value="0.3" <?php if (!(strcmp(0.3, $arealmindst))) {echo
> "selected=\"selected\"";} ?>>0.3</option>
> <option value="0.5" <?php if (!(strcmp(0.5, $arealmindst))) {echo
> "selected=\"selected\"";} ?>>0.5</option>
> <option value="0.7" <?php if (!(strcmp(0.7, $arealmindst))) {echo
> "selected=\"selected\"";} ?>>0.7</option>
> <option value="1.0" <?php if (!(strcmp(1.0, $arealmindst))) {echo
> "selected=\"selected\"";} ?>>1.0</option>
> <option value="1.5" <?php if (!(strcmp(1.5, $arealmindst))) {echo
> "selected=\"selected\"";} ?>>1.5</option>
> <option value="2.0" <?php if (!(strcmp(2.0, $arealmindst))) {echo
> "selected=\"selected\"";} ?>>2.0</option>
> <option value="2.5" <?php if (!(strcmp(2.5, $arealmindst))) {echo
> "selected=\"selected\"";} ?>>2.5</option>
> <option value="3.0" <?php if (!(strcmp(3.0, $arealmindst))) {echo
> "selected=\"selected\"";} ?>>3.0</option>
> <option value="5.0" <?php if (!(strcmp(5.0, $arealmindst))) {echo
> "selected=\"selected\"";} ?>>5.0</option>
> <option value="10.0" <?php if (!(strcmp(10.0, $arealmindst)))
> {echo "selected=\"selected\"";} ?>>10</option>
> <option value="15.0" <?php if (!(strcmp(15.0, $arealmindst)))
> {echo "selected=\"selected\"";} ?>>15</option>
> <option value="20.0" <?php if (!(strcmp(20.0, $arealmindst)))
> {echo "selected=\"selected\"";} ?>>20</option>
> <option value="25.0" <?php if (!(strcmp(25.0, $arealmindst)))
> {echo "selected=\"selected\"";} ?>>25</option>
> <option value="30.0" <?php if (!(strcmp(30.0, $arealmindst)))
> {echo "selected=\"selected\"";} ?>>30</option>
> <option value="35.0" <?php if (!(strcmp(35.0, $arealmindst)))
> {echo "selected=\"selected\"";} ?>>35</option>
> <option value="40.0" <?php if (!(strcmp(40.0, $arealmindst)))
> {echo "selected=\"selected\"";} ?>>40</option>
> <option value="50.0" <?php if (!(strcmp(50.0, $arealmindst)))
> {echo "selected=\"selected\"";} ?>>50</option>
> <option value="60.0" <?php if (!(strcmp(60.0, $arealmindst)))
> {echo "selected=\"selected\"";} ?>>60</option>
> <option value="70.0" <?php if (!(strcmp(70.0, $arealmindst)))
> {echo "selected=\"selected\"";} ?>>70</option>
> <option value="80.0" <?php if (!(strcmp(80.0, $arealmindst)))
> {echo "selected=\"selected\"";} ?>>80</option>
> <option value="90.0" <?php if (!(strcmp(90.0, $arealmindst)))
> {echo "selected=\"selected\"";} ?>>90</option>
> <option value="100.0" <?php if (!(strcmp(100.0, $arealmindst)))
> {echo "selected=\"selected\"";} ?>>100</option>
> <option value="120.0" <?php if (!(strcmp(120.0, $arealmindst)))
> {echo "selected=\"selected\"";} ?>>120</option>
> <option value="130.0" <?php if (!(strcmp(130.0, $arealmindst)))
> {echo "selected=\"selected\"";} ?>>130</option>
> <option value="150.0" <?php if (!(strcmp(150.0, $arealmindst)))
> {echo "selected=\"selected\"";} ?>>150</option>
> <option value="170.0" <?php if (!(strcmp(170.0, $arealmindst)))
> {echo "selected=\"selected\"";} ?>>170</option>
> <option value="190.0" <?php if (!(strcmp(190.0, $arealmindst))) {echo
> "selected=\"selected\"";} ?>>190</option>
> </select>
> </font></td>
> <td width="43" bgcolor="#5B7195" class="stottestyle2"><p>Areal under
> (ha)</p></td>
> <td width="101" align="right" class="tdstyle"><label><font
> face="Arial">
> <select name="arealstorst" size="1" id="arealstorst" tabindex="5">
> <option value="-1" <?php if (!(strcmp(-1, $arealstorst))) {echo
> "selected=\"selected\"";} ?>>Ingen øvre grænse</option>
> <option value="0.1" <?php if (!(strcmp(0.1, $arealstorst))) {echo
> "selected=\"selected\"";} ?>>0.1</option>
> <option value="0.2" <?php if (!(strcmp(0.2, $arealstorst))) {echo
> "selected=\"selected\"";} ?>>0.2</option>
> <option value="0.3" <?php if (!(strcmp(0.3, $arealstorst))) {echo
> "selected=\"selected\"";} ?>>0.3</option>
> <option value="0.5" <?php if (!(strcmp(0.5, $arealstorst))) {echo
> "selected=\"selected\"";} ?>>0.5</option>
> <option value="0.7" <?php if (!(strcmp(0.7, $arealstorst))) {echo
> "selected=\"selected\"";} ?>>0.7</option>
> <option value="1.0" <?php if (!(strcmp(1.0, $arealstorst))) {echo
> "selected=\"selected\"";} ?>>1.0</option>
> <option value="1.5" <?php if (!(strcmp(1.5, $arealstorst))) {echo
> "selected=\"selected\"";} ?>>1.5</option>
> <option value="2.0" <?php if (!(strcmp(2.0, $arealstorst))) {echo
> "selected=\"selected\"";} ?>>2.0</option>
> <option value="2.5" <?php if (!(strcmp(2.5, $arealstorst))) {echo
> "selected=\"selected\"";} ?>>2.5</option>
> <option value="3.0" <?php if (!(strcmp(3.0, $arealstorst))) {echo
> "selected=\"selected\"";} ?>>3.0</option>
> <option value="5.0" <?php if (!(strcmp(5.0, $arealstorst))) {echo
> "selected=\"selected\"";} ?>>5.0</option>
> <option value="10" <?php if (!(strcmp(10, $arealstorst))) {echo
> "selected=\"selected\"";} ?>>10</option>
> <option value="15" <?php if (!(strcmp(15, $arealstorst))) {echo
> "selected=\"selected\"";} ?>>15</option>
> <option value="20" <?php if (!(strcmp(20, $arealstorst))) {echo
> "selected=\"selected\"";} ?>>20</option>
> <option value="25" <?php if (!(strcmp(25, $arealstorst))) {echo
> "selected=\"selected\"";} ?>>25</option>
> <option value="30" <?php if (!(strcmp(30, $arealstorst))) {echo
> "selected=\"selected\"";} ?>>30</option>
> <option value="35" <?php if (!(strcmp(35, $arealstorst))) {echo
> "selected=\"selected\"";} ?>>35</option>
> <option value="40" <?php if (!(strcmp(40, $arealstorst))) {echo
> "selected=\"selected\"";} ?>>40</option>
> <option value="50" <?php if (!(strcmp(50, $arealstorst))) {echo
> "selected=\"selected\"";} ?>>50</option>
> <option value="60" <?php if (!(strcmp(60, $arealstorst))) {echo
> "selected=\"selected\"";} ?>>60</option>
> <option value="70" <?php if (!(strcmp(70, $arealstorst))) {echo
> "selected=\"selected\"";} ?>>70</option>
> <option value="80" <?php if (!(strcmp(80, $arealstorst))) {echo
> "selected=\"selected\"";} ?>>80</option>
> <option value="90" <?php if (!(strcmp(90, $arealstorst))) {echo
> "selected=\"selected\"";} ?>>90</option>
> <option value="100" <?php if (!(strcmp(100, $arealstorst))) {echo
> "selected=\"selected\"";} ?>>100</option>
> <option value="120" <?php if (!(strcmp(120, $arealstorst))) {echo
> "selected=\"selected\"";} ?>>120</option>
> <option value="130" <?php if (!(strcmp(130, $arealstorst))) {echo
> "selected=\"selected\"";} ?>>130</option>
> <option value="150" <?php if (!(strcmp(150, $arealstorst))) {echo
> "selected=\"selected\"";} ?>>150</option>
> <option value="170" <?php if (!(strcmp(170, $arealstorst))) {echo
> "selected=\"selected\"";} ?>>170</option>
> <option value="190" <?php if (!(strcmp(190, $arealstorst))) {echo
> "selected=\"selected\"";} ?>>190</option>
> </select>
> </font></label></td>
> <td width="101" align="right" class="tdstyle">&nbsp;</td>
> <td width="101" align="right" class="tdstyle">&nbsp;</td>
> <td width="101" align="right" class="tdstyle">&nbsp;</td>
> <td width="101" align="right" class="tdstyle">&nbsp;</td>
> </tr>
> <tr>
> <td bgcolor="#5B7195" class="stottestyle2"><span
> class="tdstyle">Brakareal over (ha)</span></td>
> <td class="tdstyle"><span class="stottestyle2"><font face="Arial">
> <select name="brakover" size="1" id="brakover" tabindex="4">
> <option value="-1" <?php if (!(strcmp(-1, $brakover))) {echo
> "selected=\"selected\"";} ?>>Ingen nedre grænse</option>
> <option value="0.1" <?php if (!(strcmp(0.1, $brakover))) {echo
> "selected=\"selected\"";} ?>>0.1</option>
> <option value="0.2" <?php if (!(strcmp(0.2, $brakover))) {echo
> "selected=\"selected\"";} ?>>0.2</option>
> <option value="0.3" <?php if (!(strcmp(0.3, $brakover))) {echo
> "selected=\"selected\"";} ?>>0.3</option>
> <option value="0.5" <?php if (!(strcmp(0.5, $brakover))) {echo
> "selected=\"selected\"";} ?>>0.5</option>
> <option value="0.7" <?php if (!(strcmp(0.7, $brakover))) {echo
> "selected=\"selected\"";} ?>>0.7</option>
> <option value="1.0" <?php if (!(strcmp(1.0, $brakover))) {echo
> "selected=\"selected\"";} ?>>1.0</option>
> <option value="1.5" <?php if (!(strcmp(1.5, $brakover))) {echo
> "selected=\"selected\"";} ?>>1.5</option>
> <option value="2.0" <?php if (!(strcmp(2.0, $brakover))) {echo
> "selected=\"selected\"";} ?>>2.0</option>
> <option value="2.5" <?php if (!(strcmp(2.5, $brakover))) {echo
> "selected=\"selected\"";} ?>>2.5</option>
> <option value="3.0" <?php if (!(strcmp(3.0, $brakover))) {echo
> "selected=\"selected\"";} ?>>3.0</option>
> <option value="5.0" <?php if (!(strcmp(5.0, $brakover))) {echo
> "selected=\"selected\"";} ?>>5.0</option>
> <option value="10" <?php if (!(strcmp(10, $brakover))) {echo
> "selected=\"selected\"";} ?>>10</option>
> <option value="15" <?php if (!(strcmp(15, $brakover))) {echo
> "selected=\"selected\"";} ?>>15</option>
> <option value="20" <?php if (!(strcmp(20, $brakover))) {echo
> "selected=\"selected\"";} ?>>20</option>
> <option value="25" <?php if (!(strcmp(25, $brakover))) {echo
> "selected=\"selected\"";} ?>>25</option>
> <option value="30" <?php if (!(strcmp(30, $brakover))) {echo
> "selected=\"selected\"";} ?>>30</option>
> <option value="35" <?php if (!(strcmp(35, $brakover))) {echo
> "selected=\"selected\"";} ?>>35</option>
> <option value="40" <?php if (!(strcmp(40, $brakover))) {echo
> "selected=\"selected\"";} ?>>40</option>
> <option value="50" <?php if (!(strcmp(50, $brakover))) {echo
> "selected=\"selected\"";} ?>>50</option>
> <option value="60" <?php if (!(strcmp(60, $brakover))) {echo
> "selected=\"selected\"";} ?>>60</option>
> <option value="70" <?php if (!(strcmp(70, $brakover))) {echo
> "selected=\"selected\"";} ?>>70</option>
> <option value="80" <?php if (!(strcmp(80, $brakover))) {echo
> "selected=\"selected\"";} ?>>80</option>
> <option value="90" <?php if (!(strcmp(90, $brakover))) {echo
> "selected=\"selected\"";} ?>>90</option>
> <option value="100" <?php if (!(strcmp(100, $brakover))) {echo
> "selected=\"selected\"";} ?>>100</option>
> <option value="120" <?php if (!(strcmp(120, $brakover))) {echo
> "selected=\"selected\"";} ?>>120</option>
> <option value="130" <?php if (!(strcmp(130, $brakover))) {echo
> "selected=\"selected\"";} ?>>130</option>
> <option value="150" <?php if (!(strcmp(150, $brakover))) {echo
> "selected=\"selected\"";} ?>>150</option>
> <option value="170" <?php if (!(strcmp(170, $brakover))) {echo
> "selected=\"selected\"";} ?>>170</option>
> <option value="190" <?php if (!(strcmp(190, $brakover))) {echo
> "selected=\"selected\"";} ?>>190</option>
> </select>
> </font></span></td>
> <td bgcolor="#5B7195" class="stottestyle2"><span
> class="tdstyle">Brakareal under (ha)</span></td>
> <td align="right" class="tdstyle"><label><font face="Arial"><font
> face="Arial"><font face="Arial"><font face="Arial">
> <select name="brakunder" size="1" id="brakunder" tabindex="4">
> <option value="-1">Ingen øvre grænse</option>
> <option value="0.1">0.1</option>
> <option value="0.2">0.2</option>
> <option value="0.3">0.3</option>
> <option value="0.5">0.5</option>
> <option value="0.7">0.7</option>
> <option value="1.0">1.0</option>
> <option value="1.5">1.5</option>
> <option value="2.0">2.0</option>
> <option value="2.5">2.5</option>
> <option value="3.0">3.0</option>
> <option value="5.0">5.0</option>
> <option value="10.0">10</option>
> <option value="15.0">15</option>
> <option value="20.0">20</option>
> <option value="25.0">25</option>
> <option value="30.0">30</option>
> <option value="35.0">35</option>
> <option value="40.0">40</option>
> <option value="50.0">50</option>
> <option value="60.0">60</option>
> <option value="70.0">70</option>
> <option value="80.0">80</option>
> <option value="90.0">90</option>
> <option value="100.0">100</option>
> <option value="120.0">120</option>
> <option value="130.0">130</option>
> <option value="150.0">150</option>
> <option value="170.0">170</option>
> <option value="190.0">190</option>
> <option value="&lt;200">Over 200</option>
> </select>
> </font></font></font></font></label></td>
> <td align="right" class="tdstyle">&nbsp;</td>
> <td align="right" class="tdstyle">&nbsp;</td>
> <td align="right" class="tdstyle">&nbsp;</td>
> <td align="right" class="tdstyle">&nbsp;</td>
> </tr>
> <tr>
> <td bgcolor="#5B7195" class="stottestyle2">Brakprocent over</td>
> <td class="tdstyle"><label>
> <select name="brakpctover" id="brakpctover">
> <option value="-1">Ingen nedre grænse</option>
> <option value="1">1</option>
> <option value="2">2</option>
> <option value="5">5</option>
> <option value="7">7</option>
> <option value="10">10</option>
> <option value="15">15</option>
> <option value="20">20</option>
> <option value="25">25</option>
> <option value="30">30</option>
> <option value="40">40</option>
> <option value="50">50</option>
> <option value="60">60</option>
> <option value="70">70</option>
> <option value="80">80</option>
> <option value="90">90</option>
> <option value="100">100</option>
> <option value="&gt;100">Over 100</option>
> </select>
> </label></td>
> <td class="stottestyle2">Brakprocent under</td>
> <td class="tdstyle"><select name="brakpctunder" id="brakpctunder">
> <option value="-1">Ingen øvre grænse</option>
> <option value="1">1</option>
> <option value="2">2</option>
> <option value="5">5</option>
> <option value="7">7</option>
> <option value="10">10</option>
> <option value="15">15</option>
> <option value="20">20</option>
> <option value="25">25</option>
> <option value="30">30</option>
> <option value="40">40</option>
> <option value="50">50</option>
> <option value="60">60</option>
> <option value="70">70</option>
> <option value="80">80</option>
> <option value="90">90</option>
> <option value="100">100</option>
> <option value="&gt;100">Over 100</option>
> </select></td>
> <td class="tdstyle">&nbsp;</td>
> <td class="tdstyle">&nbsp;</td>
> <td class="tdstyle">&nbsp;</td>
> <td class="tdstyle">&nbsp;</td>
> </tr>
> <tr>
> <td colspan="8" class="tdstyle"><div align="right"><font
> face="Arial">
> <input type="submit" name="submit" value="search"tabindex="11" />
> </font></div></td>
> </tr>
> </table>
> </form>
>
>
> <?php if ($totalRows_Recordset1 == 0) { // Show if recordset empty ?>
> <p>Ingen markblokke fundet.<br />
> Fremsøg markblokke ved at indtaste kriterier i skemaet ovenfor. </p>
> <?php } // Show if recordset empty ?>
> <?php if ($totalRows_Recordset1 > 0) { // Show if recordset not empty ?>
> Du har søgt markblokke hvor:
> <p> <?php
>
> function variableset ($var1,$var2)
> {
> if ($var1 > 0)
> {
> echo $var2. " ha.";
> }
> }
> function variableset2 ($var1,$var2)
> {
> if ($var1 > 0)
> {
> echo $var2. " %.";
> }
> }
> variableset ($arealmindst,"Mindste areal er ". $arealmindst);
> variableset($arealstorst,"<br> Største areal er: ".$arealstorst);
> variableset($brakover,"<br> Brakarealet er over: ".$brakover);
> variableset($brakunder,"<br> Brakarealer er under: ". $brakunder);
> variableset2($brakpctunder,"<br> Brakprocenten er under: ".
> $brakpctunder);
> variableset2($brakpctover,"<br> Brakprocenten er over: ". $brakpctover);
> ?>
>
> &nbsp;</p>
> <p>Der er i ialt <?php echo $totalRows_Recordset1 ?> markblokke, der
> svarer til dine søgekriterier.
>
> <?php if( $totalRows_Recordset1 > 6000)
> {
> echo "Der er over 6000 markblokke, der svarer til dine søgekriterier. Det
> er for mange, indskrænk derfor dine søgekriterier";
> exit;
> }
> ?></p>
> <p>Søgningens samlede brakareal udgør <?php echo
> $row_totalprice['totalbrak']; ?> ha.</p>
> <div align="center"></div>
> <p align="center">
> <table border="1" cellpadding="3">
> <tr class="stottestyle1">
> <td><div align="center">Markbloknr</div></td>
> <td><div align="center">Blokkens areal</div></td>
> <td><div align="center">Brakareal</div></td>
> <td><div align="center">Special_brak</div></td>
> <td><div align="center">Brakprocent</div></td>
> </tr>
> <?php do { ?>
> <tr class="stottestyle2">
> <td><div align="right"><?php echo $row_Recordset1['bloknr'];
> ?></div></td>
> <td><div align="right"><?php echo $row_Recordset1['areal'];
> ?></div></td>
> <td><div align="right"><?php echo $row_Recordset1['brakareal'];
> ?></div></td>
> <td><div align="right"><?php echo $row_Recordset1['special_brak'];
> ?></div></td>
> <td><div align="right"><?php echo $row_Recordset1['brakprocent'];
> ?></div></td>
> </tr>
> <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
> </table>
> <a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage,
> min($totalPages_Recordset1, $pageNum_Recordset1 + 1),
> $queryString_Recordset1); ?>">Next</a><br />
> <?php } // Show if recordset not empty ?>
> </body>
> </html>
> <?php
>
> mysql_free_result($Recordset1);
>
> mysql_free_result($totalprice);
> ?>
>
> "Dan Storm" <shadyz@_REMOVETHIS_err0r.dk> skrev i meddelelsen
> news:474a880f$0$15897$edfadb0f@dtext01.news.tele.dk...
>> Knud Haugmark skrev:
>>> Jeg bruger Dreamweaver til at lave php sider med - og det går rigtig
>>> godt - bortset fra en ny side med en search-form med 6 parametre.
>>> Resultatsiden (som er den samme, men det hjælper ikke at oprette en
>>> anden) viser de første 50 records og så klikker man til side to med en
>>> "next" link, som DW har lavet via sin records paging funktion. Men det
>>> virker ikke og jeg får fejl, det ser ud til at variablerne ikke kommer
>>> med, og så går sql commandoen i ged.
>>> prøv det evt her og kom gerne med erfaringer. Det er dw cs.
>>> http://www.sickpigs.dk/brak/brakbase.php
>>
>> Vi bliver nød til at se noget kildekode for at kunne hjælpe dig.
>>
>> --
>> Dan Storm - storm at err0r dot dk / http://err0r.dk
>>
>> Tro ikke brugerne vil gøre noget for at undgå dit killfilter
>> - Så vigtig er du heller ikke!
>


Philip Nunnegaard (27-11-2007)
Kommentar
Fra : Philip Nunnegaard


Dato : 27-11-07 21:56

> prøv det evt her og kom gerne med erfaringer. Det er dw cs.
> http://www.sickpigs.dk/brak/brakbase.php

Nu går der vist noget op for mig.
Selve søgeformularen har du sat til "post" i stedet for "get"
Ændr det i <form>-delen - og ditto alle de steder, hvor der står $_POST
(altså ændr det til $_GET).

Forskellen på POST og GET er, at parametrene kommer med i URLen, når der
anvendes GET.

Sørg for, at alle parametrene kommer med i next-linket, og så er der måske
en chance for, at det spiller.


Knud Haugmark (30-11-2007)
Kommentar
Fra : Knud Haugmark


Dato : 30-11-07 21:32

du havde fuldkommen ret, det funker bare nu, jeg undrer mig bare over at
variablerne ikke kommer med når man bruger post, blir de ikke liggende i en
array indtil der kommer en ny submit fra formen?
Men i alle fald mange tak for hjælpen...
Jeg skal aldrig glemme det.
Håber jeg

Knud
"Philip Nunnegaard" <philip@fjerndettehitsurf.dk> skrev i meddelelsen
news:474c847a$0$2088$edfadb0f@dtext02.news.tele.dk...
>> prøv det evt her og kom gerne med erfaringer. Det er dw cs.
>> http://www.sickpigs.dk/brak/brakbase.php
>
> Nu går der vist noget op for mig.
> Selve søgeformularen har du sat til "post" i stedet for "get"
> Ændr det i <form>-delen - og ditto alle de steder, hvor der står $_POST
> (altså ændr det til $_GET).
>
> Forskellen på POST og GET er, at parametrene kommer med i URLen, når der
> anvendes GET.
>
> Sørg for, at alle parametrene kommer med i next-linket, og så er der måske
> en chance for, at det spiller.


Philip Nunnegaard (30-11-2007)
Kommentar
Fra : Philip Nunnegaard


Dato : 30-11-07 22:37

> jeg undrer mig bare over at variablerne ikke kommer med når man bruger
> post, blir de ikke liggende i en array indtil der kommer en ny submit fra
> formen?

Den vil glemme inputsne i det øjeblik du forlader siden - f.eks. ved at
trykke på Next.
Hvis du ville bevare POST, skulle du nok lave Next-delen som en submitknap i
en formular, hvor alle de nødvendige data lå gemt i nogle <input
type="hidden" ...>

Ved søgefunktioner foretrækker jeg generelt GET, fordi brugeren derved kan
bookmarke søgningen (alle parametre ligger jo da i URLen).
Ønsker jeg derimod ikke, at brugeren skal kunne det, vil jeg vælge POST.


Søg
Reklame
Statistik
Spørgsmål : 177459
Tips : 31964
Nyheder : 719565
Indlæg : 6408195
Brugere : 218881

Månedens bedste
Årets bedste
Sidste års bedste