| | |
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 |
action address ajax apache api array auto autoincrement beginner binary broken cakephp checkbox class classes cms code cron curl database date dehasher destroy display domain dynamic echo email error errorlog file files folder form format forms function functions google href htaccess html image include insert interactive ip java javascript joomla limit link load login mail malfunctioning masterthesis menu mlm multiple mysql nodes oop paypal pdf php popup problem query radio ram random record recursion reference remote return script search server sessions sms source space sql syntax system table tutorial unset update upload url validation validator variable video web websitecontactform youtube





