| | |
Back URL function and keeping search criteria - From Natasha
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
I operate a real estate directory site.
Trouble of the day: Cannot get my Back URL to go back to the previous page with all the user' search criteria still there. It goes back to the page and they have to fill their criteria again.
Example: They pick Fiji and Islands For Sale, get a listing of Fiji islands, pick one, look at it, click on Back, return to search page but they have to reenter Fiji and Islands For sale.
My current code on my details.php:
$a = getenv('HTTP_REFERER');
//echo"hererer".$a."<br>";
$pos =strpos($a,"qualify_search");
if($pos<>""){
$bck_url="qualify_search.php?listid=$record[listingid]&region_id=$_REQUEST[region_id]&property_type=$_REQUEST[property_type]&country_id=$_REQUEST[country_id]&state_id=$_REQUEST[state_id]&maxprice=$_REQUEST[maxprice]&minprice=$_REQUEST[minprice]&keywordtxt=$_REQUEST[keywordtxt]&option_page=$_REQUEST[option_page]";
}
//echo"position".$pos;
//$baray=explode("/",$a);
/*
switch($baray[4]){
case"qualify_search.php":
$bck_url="qualify_search.php?listid=$record[listingid]&region_id=$_REQUEST[region_id]&property_type=$_REQUEST[property_type]&country_id=$_REQUEST[country_id]&state_id=$_REQUEST[state_id]&maxprice=$_REQUEST[maxprice]&minprice=$_REQUEST[minprice]&keywordtxt=$_REQUEST[keywordtxt]";
break;
}
It seems simple enough. What is wrong with me today?
Thanks for your help.
Natasha
Trouble of the day: Cannot get my Back URL to go back to the previous page with all the user' search criteria still there. It goes back to the page and they have to fill their criteria again.
Example: They pick Fiji and Islands For Sale, get a listing of Fiji islands, pick one, look at it, click on Back, return to search page but they have to reenter Fiji and Islands For sale.
My current code on my details.php:
$a = getenv('HTTP_REFERER');
//echo"hererer".$a."<br>";
$pos =strpos($a,"qualify_search");
if($pos<>""){
$bck_url="qualify_search.php?listid=$record[listingid]&region_id=$_REQUEST[region_id]&property_type=$_REQUEST[property_type]&country_id=$_REQUEST[country_id]&state_id=$_REQUEST[state_id]&maxprice=$_REQUEST[maxprice]&minprice=$_REQUEST[minprice]&keywordtxt=$_REQUEST[keywordtxt]&option_page=$_REQUEST[option_page]";
}
//echo"position".$pos;
//$baray=explode("/",$a);
/*
switch($baray[4]){
case"qualify_search.php":
$bck_url="qualify_search.php?listid=$record[listingid]&region_id=$_REQUEST[region_id]&property_type=$_REQUEST[property_type]&country_id=$_REQUEST[country_id]&state_id=$_REQUEST[state_id]&maxprice=$_REQUEST[maxprice]&minprice=$_REQUEST[minprice]&keywordtxt=$_REQUEST[keywordtxt]";
break;
}
It seems simple enough. What is wrong with me today?
Thanks for your help.
Natasha
Do you mean the back button on the browser or do you have a back link on the page?
With your code you should be able to go back using the url vars, but depending on how your search page works it may not work with the browsers back button
With your code you should be able to go back using the url vars, but depending on how your search page works it may not work with the browsers back button
Last edited by Will Gresham; Nov 6th, 2008 at 3:53 pm.
AJAX is not a programming language, scripting language or any other sort of language.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
![]() |
Other Threads in the PHP Forum
- Previous Thread: Bad word filter
- Next Thread: converting array from mysql database into a different mysql table
| Thread Tools | Search this Thread |
.htaccess apache api array autocomplete beginner binary broken cakephp class cms code convert cron curl database dataentry date display duplicates dynamic ebooks email emptydisplayvalue error execute explodefunction file firstoptioninphpdroplist folder form forms function functions google hack href htaccess html htmlspecialchars image include ip javasciptvalidation javascript joomla keywords limit link list login mail matching mediawiki menu methods multiple mysql network number object oop paypal pdf php phpincludeissue query random recursive redirect remote script search securephp seo server sessions shot source sp space speed sql subdomain subscription system table tag tutorial tutorials upload url validator variable vbulletin video web webdesign white youtube





