This is a discussion on "problem with travel site search engine" within the Search Engine Optimization (SEO) section. This forum, and the thread "problem with travel site search engine are both part of the Promote Your Website category.
|
|
|
|
|
![]() |
||
problem with travel site search engine
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
I have a problem with my search engine, when you search for Spain you get no results at all even though there are loads of properties available, and the 2nd problem is that if you search for France for example and get more than one page, only the results for the first 10 properties show up and the other pages have a -9 to 0 result and no properties. I would like to get a web designer who knows what they are doing so would this be a php problem or some other type of problem. Are there people who just specialise in search engine problems? thks. btw the link is http://www.letsrent2me.com/search.php
|
|
|
|
#2
|
|||
|
|||
|
Re: problem with travel site search engine
Without seeing the code I would say this is probably a mixture of php and mysql causing your problems.
|
|
#3
|
|||
|
|||
|
Re: problem with travel site search engine
Thks dab42pat I have written to a web designer this p.m. so hopefully should receive a quote to sort it out. I don't understand how one minute the search engine is working ok and the next it packs up. This is the code from my search.php script...
if(isset($_POST['Reset'])) { header("Location:search.php"); exit(); } if(isset($_POST['search'])) { unset($_POST['prevpage']); unset($_POST['nextpage']); unset($_POST['pages']); } session_cache_limiter("public"); session_start(); //$posted.=print_r($_POST,1);echo $posted; //search properties if(isset($_POST['pages'])) { $page=''; for ($i=1; $i<=$pages; $i++) { //echo $_POST["p$i"]; if (isset($_POST["p$i"])) $page=$_POST["p$i"]; } if(isset($_POST['prevpage']) && isset($_POST['pprev'])) $page=$_POST['prevpage']; if(isset($_POST['nextpage']) && isset($_POST['pnext'])) $page=$_POST['nextpage']; if(!is_numeric($page) && $page!='') { header("Location:index.php"); exit(); } } if (isset($_POST['quicksearch']) && $_POST['quicksearch']) $quick="<input name='quicksearch' type='hidden' value=\"".$_POST['quicksearch']."\" />"; else $quick=''; if (isset($_POST['search']) && $_POST['search']!='Go') $quick=''; include"common/defined.php"; include"common/functions.php"; include "common/patTemplate.php"; $e = new DbError(); $template = new patTemplate(); $template->setBasedir("templates"); $template->readTemplatesFromFile("search_property.tpl"); $template->readTemplatesFromFile("common.tpl"); $template->addVar("search_property", "PAGE_TITLE", WEBSITENAME.":Holiday Rental Property Search"); //CONFIG *****number of listing summaries per results page $limit="10"; mysql_connect($host, $user, $pass) or $e->raiseError(102, "error"); mysql_select_db($db) or $e->raiseError(104, "error"); //get selecters $query="SELECT proptype,loctype,countries FROM config WHERE sitename='phericheproperty' LIMIT 1"; $result=mysql_query($query)or die("error". mysql_error()); $item = mysql_fetch_object($result); $proptypes=$item->proptype;$proptype_array=explode(",",$proptypes ); $countries=$item->countries;$countries_array=explode(",",$countries ); if (isset($_POST['prop_type'])) $prop_type=$_POST['prop_type']; else $prop_type=''; $options=""; foreach($proptype_array as $value){ $value=trim($value); if ($value==$prop_type) $options.="<option value='$value' selected='selected'> $value </option> \n"; else $options.="<option value='$value'> $value </option> \n";} $template->addVar("search_property", "PROP_TYPE", $options); // New option for sale or rental - 29/3/07 - fearntech.co.uk $saletype=''; if (isset($_POST['prop_saletype']) && $_POST['prop_saletype']) { $saletype=$_POST['prop_saletype']; } if (isset($_POST['country'])) $country=$_POST['country']; else $country=''; $options=""; foreach($countries_array as $value){ $value=trim($value); if ($country==$value) $options.="<option value='$value' selected='selected'> $value </option> \n"; else $options.="<option value='$value'> $value </option> \n";} $template->addVar("search_property", "COUNTRYSEL", $options); if (isset($_POST['minbedsearch']) && $_POST['minbedsearch']) $minbeds=ereg_replace("[^0-9.]", "", $_POST['minbedsearch']); else $minbeds=''; $options=""; for ($i=1; $i<=9; $i++) { if ($i==$minbeds) $options.="<option value='$i' selected='selected'>$i</option>"; else $options.="<option value='$i'>$i</option>"; } $template->addVar("search_property", "MINBEDS", $options); if (isset($_POST['minbathsearch']) && $_POST['minbathsearch']) $minbaths=ereg_replace("[^0-9.]", "", $_POST['minbathsearch']); else $minbaths=''; $options=""; for ($i=1; $i<=4; $i++) { if ($i==$minbaths) $options.="<option value='$i' selected='selected'>$i</option>"; else $options.="<option value='$i'>$i</option>"; } $template->addVar("search_property", "MINBATHS", $options); // Min and max prices $price[0]=0; $price[1]=50000; $price[2]=100000; $price[3]=150000; $price[4]=200000; $price[5]=250000; $price[6]=300000; $price[7]=400000; $price[8]=500000; $price[9]=600000; $price[10]=700000; $price[11]=800000; $price[12]=900000; $price[13]=1000000; if (isset($_POST['minpricesearch']) && $_POST['minpricesearch']) $minprice=ereg_replace("[^0-9.]", "", $_POST['minpricesearch']); else $minprice=''; $options=""; for ($i=0; $i<=13; $i++) { if ($minprice=='') $pricecheck=99; else $pricecheck=$minprice; if ($price[$i]==$pricecheck) $options.="<option value='$price[$i]' selected='selected'>€".number_format($price[$i])."</option>"; else $options.="<option value='$price[$i]'>€".number_format($price[$i])."</option>"; } $template->addVar("search_property", "MINPRICE", $options); if (isset($_POST['maxpricesearch']) && $_POST['maxpricesearch']) $maxprice=ereg_replace("[^0-9.]", "", $_POST['maxpricesearch']); else $maxprice=''; $options=""; for ($i=1; $i<=13; $i++) { if ($price[$i]==$maxprice) $options.="<option value='$price[$i]' selected='selected'>€".number_format($price[$i])."</option>"; else $options.="<option value='$price[$i]'>€".number_format($price[$i])."</option>"; } $template->addVar("search_property", "MAXPRICE", $options); $options=""; if ($minprice!='' || $maxprice!='') $saletype="For Sale"; if ($saletype=="For Sale") $options="<option value=''></option><option value='Rental'>Rental</option><option value='For Sale' selected='selected'>For Sale</option>"; else if ($saletype=="Rental") $options="<option value=''></option><option value='Rental' selected='selected'>Rental</option><option value='For Sale'>For Sale</option>"; else $options="<option value='' selected='selected'></option><option value='Rental'>Rental</option><option value='For Sale'>For Sale</option>"; $template->addVar("search_property", "PROP_SALETYPE", $options); if(!isset($_POST['search']) && !isset($_POST['pages'])) { $template->DisplayParsedTemplate("search_property"); exit(); } else { $searchterm=""; //$posted.=print_r($_POST,1);echo"<p class='red'>".$posted."</p>"; if(isset($_POST['search'])){unset($page);} //{ if (isset($_GET['search'])) {$searchterm=rawurldecode($_GET['search']); } } //{ if (isset($_GET['type'])) { $srchptype=rawurldecode($_GET['type']); } } if ($quick!='') {$searchterm.=$_POST['quicksearch']." ";} if (isset($_POST['placesearch']) && $_POST['placesearch']) {$searchterm.=$_POST['placesearch']." ";} if (isset($_POST['country']) && $_POST['country']) {$searchterm.=$_POST['country']." ";} if (isset($_POST['prop_type']) && $_POST['prop_type']) {$srchptype=$_POST['prop_type']; $srchptype=strip_tags(stripslashes(trim($srchptype ))); if (in_array($srchptype,$proptype_array)){$enctype=ra wurlencode($srchptype); }else { unset($srchptype); } } // Bring in new search items - Paul Fearn 30/03/07 - fearntech.co.uk $newsearch=''; // Search by For-sale/Rental if ($saletype=="For Sale") $newsearch=" and prop_forsale='For Sale'"; else if ($saletype=="Rental") $newsearch=" and prop_forsale=''"; // Search by price if (isset($_POST['maxpricesearch']) && $_POST['maxpricesearch']) $maxprice=ereg_replace("[^0-9.]", "", $_POST['maxpricesearch']); else $maxprice=''; if ($minprice!='' && $maxprice!='') $newsearch.=" and ((prop_loseason>=$minprice and prop_loseason<=$maxprice) or (prop_hiseason>=$minprice and prop_hiseason<=$maxprice) or (prop_forsaleprice>=$minprice and prop_forsaleprice<=$maxprice))"; else if ($minprice!='') $newsearch.=" and (prop_loseason>=$minprice or prop_hiseason>=$minprice or prop_forsaleprice>=$minprice)"; else if ($maxprice!='') $newsearch.=" and (prop_loseason<=$maxprice or prop_hiseason<=$maxprice or prop_forsaleprice<=$maxprice)"; // Have added to template so can just use POST, rewrite whole search so that can just use POST $template->addVar("search_property", "SALETYPE", $saletype); if (isset($_POST['placesearch'])) $place=$_POST['placesearch']; else $place=''; $template->addVar("search_property", "PLACE", $place); // Search by beds if ($minbeds!='') $newsearch.=" and (prop_beddbl+prop_bedtwn+prop_bedsng+prop_bedfam)> =$minbeds"; // Search by baths if ($minbaths!='') $newsearch.=" and prop_bath>=$minbaths"; $template->addVar("search_property", "QUICKSEARCH", $quick); $srch_extra="active_flag='1' $newsearch"; if ($srchptype) { $srch_extra.=" AND prop_type='$srchptype' " ; $enctype=rawurlencode($srchptype); } if ($searchterm!=="") { $searchterm= strip_tags(stripslashes(strtolower(trim($searchter m)))); $searchterm = preg_replace ( "{[^a-zA-Z0-9£#@%+=,.?!_-]}" ," " , $searchterm) ; $encsrch=rawurlencode($searchterm); $where=" MATCH ( prop_country,prop_town,prop_region,prop_type )AGAINST ('$searchterm') AND $srch_extra "; } else { $where=" $srch_extra "; } //echo "!$where!"; //catch no search term case if (($searchterm=="")&&(!$srchptype)&&$newsearch=='') { $template->addVar("search_property", "OUTPUT", "<p>Please Select one of the search options and try again.</p>"); $template->DisplayParsedTemplate("search_property"); exit(); } $countquery="SELECT prop_id FROM property WHERE $where"; //echo "*$countquery*"; $result = mysql_query($countquery) or $e->raiseError(101, "error"); $count = mysql_num_rows($result); if($count==0){ $template->addVar("search_property", "OUTPUT", "<p>Your search returned No Results .Try again.</p>"); $template->DisplayParsedTemplate("search_property"); exit(); }else{ $template->setAttribute("proplister", "visibility", "visible"); $template->addVar("search_property", "OUTPUT", "<p>Your search returned $count Results .</p>"); if ($encsrch) {$getstuff.="&search=$encsrch"; } if ($enctype) {$getstuff.="&type=$enctype"; } /*dynamic page number links*/ $pages = ceil ($count/$limit); if (!isset($page)){$page='1';} $start = ($page-1) * $limit; $starting_no = $start + 1; if ($count - $start < $limit){$end_count = $count;} elseif ($count - $start >= $limit) { $end_count = $start + $limit;} if ($count - $end_count >$limit){$rest = $limit;} elseif ($count - $end_count <= $limit){ $rest = $count - $end_count; } // previous link (if you're on any page besides the first, create previous link) $links=" <hr>"; if($pages==1) { $links.=""; } else { $links.= "<div class='viewpageslinksbar'>Pages "; if ($page>1) { $links.= "<input name='pprev' type='submit' id='pprev' value='<'><input name='prevpage' type='hidden' value='".($page-1)."' />"; } else { $links.= "<a href='#' class='deadlink'><</a>"; } $links.=" "; for ($i=1; $i<=$pages; $i++) { if ($i!=$page) { $links.="<input name='p$i' type='submit' id='p$i' value='$i'>"; } else { $links.="<b class='selected'>".$i."</b>"; } } $links.=" "; // next link (if the page you are on is less than the total amount of page numbers, there are more pages left) if ($page<$pages) { $links.="<input name='pnext' type='submit' id='pnext' value='>'><input name='nextpage' type='hidden' value='".($page+1)."' />"; } else { $links.="<a class='deadlink'>></a>"; } $links.=" | Properties $starting_no to $end_count, of $count <input name='pages' type='hidden' value='".($pages)."' /></div>"; } $template->addVar("search_property", "PAGE_LINKS", $links); /**PAGE LINKS **/ $searchquery= "SELECT * FROM property WHERE $where LIMIT $start,$limit"; //echo "|$searchquery|"; $result = mysql_query($searchquery) or $e->raiseError(101, "error"); while($item = mysql_fetch_object($result)){ $agent_uid=$item->agent_uid;$prop_id=$item->prop_id; $template->addVar("proplister", "PROP_ID",$prop_id ); $template->addVar("proplister", "AGENT_ID",$agent_uid ); $template->addVar("proplister", "PROP_TITLE",$item->prop_title ); $prop_forsale=$item->prop_forsale; if ($prop_forsale=="For Sale") $prop_forsale="<img src='img/for-sale.gif' style='border:none' />"; else $prop_forsale="<img src='img/rental.gif' style='border:none' />"; $template->addVar("proplister", "PROP_FORSALE",$prop_forsale); $template->addVar("proplister", "PROP_SUM",$item->prop_summary ); $template->addVar("proplister", "PROP_TYPE",$item->prop_type ); $template->addVar("proplister", "COUNTRY",$item->prop_country ); $template->addVar("proplister", "PROP_TOWN",$item->prop_town ); $thumbfile= $item->prop_thumb; $thumbpath= $item->prop_thumbpath; $the_path="agents/img/".$agent_uid."/"; //with trailing slash $prop_code=AGPREFIX.$agent_uid."-".$prop_id; $thum_path=$the_path.$thumbpath."/thumbs/thum_".$thumbfile; if (is_file($thum_path)) {$img_string="<img src='".$thum_path."' class='floatright' alt='$prop_code'>";} else {$img_string=""; } $template->addVar("proplister","PROP_PIC",$img_string); $template->addVar("proplister", "PROP_CODE",$prop_code ); $create_date=date (" d M Y", $item->prop_createdate); $template->addVar("proplister", "PROP_CDATE",$create_date); $template->parseTemplate("proplister", "a"); } /* echo $searchquery;*/ $template->DisplayParsedTemplate("search_property"); exit(); } } ?> |
|
#4
|
|||
|
|||
|
Re: problem with travel site search engine
I think that you need to #include some meta tags to have more relevant SERP location for the each page which is connected for the certain country.
|
|
#5
|
|||
|
|||
|
Re: problem with travel site search engine
You need to talk to the company who designed your site. Many modules are linked together and just by looking at one page code, I doubt if anyone can really help you.
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How do I get my site on a search engine? | thewebkid | Search Engine Optimization (SEO) | 21 | Feb 22nd, 2008 11:33 |
| Add search engine to my site | sedjav | Web Page Design | 2 | Jul 11th, 2007 17:23 |
| Submit your site to our search engine | click2britain | Link Building and Link Sales | 1 | Aug 19th, 2006 10:09 |
| My site does not appear in search engine ! | shaweetareek | Web Page Design | 2 | Jan 7th, 2006 18:20 |