Skip to main content
Known Participant
October 25, 2009
Question

How do I keep a Repeat Region after selection?

  • October 25, 2009
  • 1 reply
  • 955 views

I have a Link/Menu button where the user chooses a city.  That populates a table with all the courses for that city.  Then the user can select any course to show information about that course I have the link set like this, charlottenccourses.php?course=<?php echo $row_getAll['course'];?>.  That is working fine, but when they select it, the table with the courses for the city disappears. So they have to select it again and hit go to see the courses again.  How can I make that stay to the same city with all the courses until they choose another one?  Thanks!

This topic has been closed for replies.

1 reply

David_Powers
Inspiring
October 26, 2009

Your description is rather vague, so it's not 100% clear what you're doing. However, hopefully, the following should point you in the right direction.

As I understand it, you have a list of courses available in a city, and the link goes to a detail page. Instead of just using the course ID in the link to the detail page, include a parameter for the city, too. You can then create a link back to the list of courses for that city in the detail page.

The link to the details page should look something like this: details.php?course=157&city=Chicago.

In the details page, use $_GET['course'] to display the details of the course, and use $_GET['city'] to create a link back to the list of all courses (courses.php?city=<?php echo $_GET['city']; ?>).

Rick4209Author
Known Participant
October 26, 2009

What I have is all on the same page. Let me explain. I have a list/menu

that displays all the cities. Once that is selected, I have a "GO" button

and that creates the table list of all the course in a repeat region. And

the rest of the page is a record set for which course is selected so it

previews information for the course selected. The link is this:

charlottenccourses.php?course=<?php echo $row_getAll['course']; ?>

Once that is selected all the information for that course appears. The

problem is, the original list of courses from the selected city now

disappears. So the user has to go back and select the city, "GO" button if

they want to preview another course. I want to figure out a way to keep that

list of courses there even when the course is selected.

Is there a way to do that will the current structure of the page?

David_Powers
Inspiring
October 26, 2009

It's basically the same. When the user clicks the link, the whole page is built again, so the link needs to contain parameters for both the city and the course. Then, when the page is rebuilt, it rebuilds the course list as well as displaying the details of the individual course.