Welcome!

And don't forget to edit your signature & profile.

 

Icon

Statistics

  • Total posts 23318
  • Total topics 4048
  • Total members 5574
  • Our newest member
    ALF5583

TOP POSTERS

Keep search results

All problems and developments related to PHP, Ruby on Rails & Co. are discussed and resolved here.
   

Keep search results

Postby Jeer » Tue Oct 13, 2009 6:53 am

Hello,

I've the following problem. I have a search page with all different kind of arrangements. These are selected random and a stored in a session (because there are only displayed 20 per page)

But these session has to stay the same when a user selects a arrangement and goes back to the overal search page.

The arrangements are devided into 4 types. And they all load on the same search page. When I select type 2 there should be made a new session for type 2 if it isn't there yet. When I select type 1 there sould be made a new session for type 1 if it isn't there yet. So you get my point?

The problem is that when I go to the website and select type 1 it all goes well without any problems. But when I select type 2 it shows no results because it cant come through the isset check.

So my code is:
Code: Select all
if(isset($resultaat[''.$type_id.''])){ // so if array $resultaat[''.$type_id.''] is not NULL
        if($_GET["posts"] == ""){ // If you are not switching page within the type
              include("html/search_session.php"); // make new session
        }
}

$resultaat = array();
if($type_id == '1'){
    $resultaat['1'] = ''.$_SESSION['paginas'].'';
}elseif($type_id == '2'){
    $resultaat['2'] = ''.$_SESSION['paginas'].'';
}elseif($type_id == '3'){
    $resultaat['3'] = ''.$_SESSION['paginas'].'';
}elseif($type_id == '4'){
    $resultaat['4'] = ''.$_SESSION['paginas'].'';
}


Do you get my point? And could somebody help me?
Jeer
Smashing <frame>
 
Posts: 17
Joined: Thu Sep 24, 2009 7:34 am
Location: Maasbree
   

Return to Server-side Scripting



Who is online

Users browsing this forum: No registered users and 2 guests