Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
I keep losing the parameters I specified in my search in place of default ones
Old 05-30-2005, 08:37 AM I keep losing the parameters I specified in my search in place of default ones
Experienced Talker

Posts: 36
Trades: 0
Hello.

I am trying to create a set-up where I enter, in a search box, some search parameters. After pressing submit I am taken to a page where the results are displayed. On this results page there are 2 Div Layers, where one layer displays the results in 'Master' form and the other layer displays the selected results in 'Details' form.

My problem is that after I have selected a result from the list of results produced from the search, that list then refreshes and the values entered as search parameters are lost - and the refreshed list lists the results using the default values specified if no values are entered in the search.

So for example - A search box with language and city drop down menu:

(The initial search box lists all 'English' Teachers in 'Saitama' as the default value if no other values are specified)

A search is carried out for all Spanish Teachers in Osaka - this displays a list of Spanish teachers in Osaka

After a record is selected and details shown, the list then refreshes and now displays all English teachers in Saitama - arrghh!.

Any help would be really appreciated. I can't script nor programme and do all of this through Dreamweaver so please assume I don't know much.

If that made none or little sense, a test version of the application is at

http://www.orangutanenglish.com/complexsearchpage1.htm

Many thanks for any suggestions or advice (I've been trying to work this out for a while now )

Best Regards
jool is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-30-2005, 09:16 AM
Marvin Le Rouge's Avatar
Skilled Talker

Posts: 52
Trades: 0
Hi,

I think you should put your search parameters in your selection link, so you retrieve them after each selection.
Marvin Le Rouge is offline
Reply With Quote
View Public Profile
 
Old 05-30-2005, 09:41 AM
Experienced Talker

Posts: 36
Trades: 0
Thanks for the response Marvin.

Sorry if I seem pretty dull here, but would the selection link be:

<td><a href="results2.php?recordID=<?php echo $row_a['autonumber']; ?>"><?php echo $row_a['firstname']; ?></a></td>

and the serach parameters $language and $prefecture?
jool is offline
Reply With Quote
View Public Profile
 
Old 05-30-2005, 09:44 AM
Experienced Talker

Posts: 36
Trades: 0
I think what I am trying to do is a lot clearer here (sorry)

http://www.orangutanenglish.com/complexsearchpage2.htm
jool is offline
Reply With Quote
View Public Profile
 
Old 05-30-2005, 12:43 PM
Marvin Le Rouge's Avatar
Skilled Talker

Posts: 52
Trades: 0
No, i meant that you should include your "language" and "place" parameters in your link.
When you use the first form, you transmit language and place, so they can be treated, but they do not exist anymore after. That's why it doesn't work once you select someone : you give the person id, but not the language neither the place.
Marvin Le Rouge is offline
Reply With Quote
View Public Profile
 
Old 05-30-2005, 05:45 PM
metho's Avatar
Ultra Talker

Posts: 481
Location: Gold Coast - Brisbane QLD, Australia
Trades: 0
When you use the search form for the first time, the parameters are POSTed to the records page. As soon as the user hits a link or refreshes, those params are lost.

So you have to include those POSTed params in any links the user may hit as well.

A link in the master list reiterates these params AND the record ID params as GET values. You'll also have to accomodate some flexibility into your mysql query values so that they can receive language and prefecture values as either GET or POST values on the master/detail page.

e.g.

At the top of your master/detail page, on Lisa1.php ?, code in your flexibility for the values as either GETs or POSTs:

PHP Code:
// user has submitted the search form

if(isset($_POST['Submit'])){
$language $_POST['language'];
$prefecture $_POST['prefecture'];
}

// user has selected a master link

if(isset($_GET['recordID'])){
$language $_GET['language'];
$prefecture $_GET['prefecture'];

So a master link will look like something along these lines:

PHP Code:

<a href="Lisa1.php?language=<?php echo $language?>&prefecture=<?php echo $prefecture?>&recordID=<?php echo $row_a['autonumber']; ?>"><?php echo $row_a['firstname']; ?></a>
__________________
I do
Please login or register to view this content. Registration is FREE
based.
Spend a lot of time in
Please login or register to view this content. Registration is FREE
.
And
Please login or register to view this content. Registration is FREE
chews up the rest.
metho is offline
Reply With Quote
View Public Profile Visit metho's homepage!
 
Old 06-01-2005, 04:18 AM
Experienced Talker

Posts: 36
Trades: 0
Got it! Thanks very much for that Metho and Marvin Le Rouge.

Metho - I really appreciate the time you've taken to help me with this one. Have a superb day and thank you thank you thank you!
jool is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to I keep losing the parameters I specified in my search in place of default ones
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.27704 seconds with 12 queries