Forum » Server-Side scripting » Search script
http://www.hogwartscastle
Berichten: 217
avatar
Offline Stuur privebericht
Hey,

Ik ben bezig met een uitgebreide zoekscript maar nu wil heb ik een paginanummering. Maar als je bijvoorbeeld gaat naar een andere pagina dan doet ie dat niet en dan zegt hij dat ik niks hebt ingevuld.

Hoe kan ik ervoor zorgen dat hij gewoon in een sessie opslaat welke resultaten ik zoek en die dan in de paginatie zetten.

Code:
Code | Selecteer Alles
minimaliseren
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?php
include 'includes/config.php';

if(
$param[1] == 'zoek')
{
       
$aantalpro $core->mysql->query("SELECT
                                                                1
                                                                  
                                            FROM
                                                producten
                                           WHERE 
                                                subsubcat LIKE '%"
.$core->mysql->escape($_POST['subsub'])."%'
                                            AND
                                                prijs >= '"
.$core->mysql->escape($_POST['van'])."'
                                            AND
                                                prijs <= '"
.$core->mysql->escape($_POST['tot'])."'
                                            OR
                                                 merk_product LIKE '%"
.$core->mysql->escape($_POST['merk'])."%'
                                           "
);
                
$totaal  $core->mysql->num_rows($aantalpro); 
                
$huidige = (isset($param[2]) && ctype_digit($param[2]) && $param[2] > 0) ? $param[2] : 1;
                
$per_pagina 8;    
                
$str paging('uitgebreid_zoeken/'.$core->mysql->escape($param[1]).'/'$totaal$per_pagina$huidige);
   

            
$lQuery $core->mysql->query("SELECT 
                                                *
                                            FROM 
                                                producten
                                            WHERE 
                                                subsubcat LIKE '%"
.$core->mysql->escape($_POST['subsub'])."%'
                                            AND
                                                prijs >= '"
.$core->mysql->escape($_POST['van'])."'
                                            AND
                                                prijs <= '"
.$core->mysql->escape($_POST['tot'])."'
                                            OR
                                                 merk_product LIKE '%"
.$core->mysql->escape($_POST['merk'])."%'
                                            ORDER BY id
                                             LIMIT
                                                "
.(($huidige $per_pagina) - $per_pagina).", ".$per_pagina);
            if(
$core->mysql->num_rows($lQuery) == 0)
            {        
                
$pageTitle 'Helaas!';
                include 
'includes/header.php';
                echo 
'<h1>Helaas!</h1>
                        <div class="error">Er zijn geen resultaten gevonden.</div>'
;
            }
            else
            {
             
                
$pageTitle 'Zoekresultaten';
                include 
'includes/header.php';
                
                echo 
'<h1>Zoekresultaten</h1>';
                
                while(
$lFetch $core->mysql->fetch($lQuery))
                {
                    
?>
                       <div class='aanbieding' style="padding-top:  10px;">
                        <div style="float:  left; width: 130px;">
                            <img src="<?php echo $lFetch['afbeelding_groot']; ?>" style="width:  100px; height: 80px;"  alt="" class="pic" />
                           <h2>&euro;<?php echo $lFetch['prijs']; ?></h2>
                        </div>
                        <p style="float: left; padding-left:  5px;"><strong style="color: #008000;"><?php echo substr($lFetch['naam'], 040); ?></strong><?php echo substr($lFetch['beschrijving'], 0120); ?>..
                        
                        <a href="<?php echo _ROOT_?>product/<?php echo $lFetch['id']; ?>" class='button'>
                            Informatie
                        </a>
                        <a target="_blank" href="<?php echo _ROOT_?>bestellen/<?php echo $lFetch['id']; ?>" class='button'>
                            Bestellen
                        </a>
                        </p>
                    </div>
                    
                    <?php
                
}
                
                echo 
$str;
                
                
?>
                
                 <script type="text/javascript"><!-- 
                   google_ad_client = "ca-pub-6123599624724980";
                        /* elektronicaland_728x90 */
                        google_ad_slot = "4605274423";
                        google_ad_width = 728;
                        google_ad_height = 90;
                        //-->
                </script>
                
                <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
          
                <?php
                
            
}
        
  }        
include 
'includes/footer.php';
?>

11-12-2010 20:40
Dit topic is 141 keer bekeken door 32 verschillende leden
Reacties op: "Search script"
 Volgende pagina
Er zijn nog geen reacties geplaatst op dit topic.
Je kan niet reageren omdat je niet bent ingelogd. Inloggen of Aanmelden