oracle765
-
Posts
219 -
Joined
-
Last visited
Posts posted by oracle765
-
-
hi there sorry as my internet has been down for 2 days the q is a variable where the urls are stored which are dynamic for every hotel
-
Hi Professionals
I am currently going through the process of grading my website in MOZ tools and getting over 2000 URLs to crawl errors
The url I have is currently
www.myurl.com.au/hotel_details.php?hotel_id=358705¤cy_code=AUD&q=%27%3A%2F%2Fwww.travelnow.com%2Ftemplates%2F451536%2Fhotels%2F358705%2Foverview%3Flang%3Den%26amp%3Bcurrency%3DAUD%26amp%3BstandardCheckin%3D12%2F17%2F2014%26amp%3BstandardCheckout%3D12%2F18%2F2014%26amp%3BroomsCount%3D1%26amp%3Brooms[0].adultsCount%3D2%27&price=149&totlday=1 How or where would I go about re-writing this I am not a professional with PHP and I have never done anything like this before
Thanks in advance
-
thanks hansford that worked a treat
-
Hi Csharp
I am looking into this, thanks all for the replies
-
hi sorry I have been away, my Skype is alan.lynch81
-
thanks for this mac_giver but to be honest I got this done offshore and I would not know where to start, if anyone is skilled enough to do some freelance work I would be happy to arrange something
thanks
-
<?php require_once('config/config.php'); include ("files/viator/api.php"); $page = new PhpCode(); $current_page = $page->curPageURL(); $_SESSION['last_page'] = $current_page ; function seoUrl($string) { //Lower case everything $string = strtolower($string); //Make alphanumeric (removes all other characters) $string = preg_replace("/[^a-z0-9_\s-]/", "", $string); //Clean up multiple dashes or whitespaces $string = preg_replace("/[\s-]+/", " ", $string); //Convert whitespaces and underscore to dash $string = preg_replace("/[\s_]/", "-", $string); return $string; } if(isset($_GET['submit']) && !empty($_GET['submit'])) { $lookupId = $_GET['lookupId']; $dest_code = $_GET['dest_code']; $currency_code = $_GET['currency_code']; $sortOrder = $_GET['sortOrder']; $catId = $_GET['catId']; $subcategoryId = $_GET['subcategoryId']; $country_name = $_GET['country_name']; $state_name = $_GET['state_name']; $country_dest_id= $_GET['country_dest_id']; $check_in = $_GET['check_in']; $check_out = $_GET['check_out']; if($dest_code =='' && $country_dest_id != '') { $dest_code = $country_dest_id; } } else if(isset($_GET['search_submit']) && !empty($_GET['search_submit'])){ $dest_code = $_GET['dest_code']; $currency_code = $_GET['currency_code']; $sortOrder = $_GET['sortOrder']; $catId = $_GET['catId']; $subcategoryId = $_GET['subcategoryId']; $country_name = $_GET['country_name']; $state_name = $_GET['state_name']; $country_dest_id= $_GET['country_dest_id']; $check_in = $_GET['check_in']; $check_out = $_GET['check_out']; $lookupId = $_GET['lookupId']; if($dest_code =='' && $country_dest_id != '') { $dest_code = $country_dest_id; } } else { $lookupId = $_GET['lookupId']; $dest_code = $_GET['dest_code']; $currency_code = $_GET['currency_code']; $sortOrder = $_GET['sortOrder']; $catId = $_GET['catId']; $subcategoryId = $_GET['subcategoryId']; $country_name = $_GET['country_name']; $state_name = $_GET['state_name']; $country_dest_id= $_GET['country_dest_id']; $check_in = $_GET['check_in']; $check_out = $_GET['check_out']; if($dest_code =='' && $country_dest_id != '') { $dest_code = $country_dest_id; } } $getdataarr = getAdventureSearch($dest_code,$currency_code,$sortOrder,$check_in,$check_out); $adventure_data_arr = $getdataarr['data']; $image = '' ; $part = new Body(); $title = "Things to do in "; if($state_name !="") { $title .= $state_name.' ' ;} if ($country_name=="United States of America") { $title .= 'USA ' ; $breadcrumb = 'USA';} elseif ($country_name=="United Arab Emirates") { $title .= 'UAE ' ; $breadcrumb = 'UAE'; } elseif ($country_name!="") { $title .= $country_name; } $title .= " | Compare & Choose"; $meta = '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="description" content="' .$state_name. ' Attractions & Things to do in ' .$country_name. '. Find your adventure in ' .$country_name. ' Today." /><link rel="canonical" href="//www.compareandchoose.com.au/adventure_list"/> <!-- MICROFORMATS FOR GPLUS --> <link href="https://plus.google.com/+CompareandchooseAuTravel/posts" rel="publisher" /> <meta itemprop="name" content="' .$title. '"> <meta itemprop="description" content="' .$state_name. ' Attractions & Things to do in ' .$country_name. '. Find your adventure in ' .$country_name. ' Today."> <meta property="og:locale" content="en_US" /> <meta property="og:type" content="website" /> <meta property="og:title" content="' .$title. '" /> <meta property="og:description" content="' .$state_name. ' Attractions & Things to do in ' .$country_name. '. Find your adventure in ' .$country_name. ' Today." /> <meta property="og:url" content="http://www.compareandchoose.com.au/" /> <meta property="og:site_name" content="Compare and Choose" /> <meta property="article:publisher" content="https://www.facebook.com/compareandchoose" /> <meta property="fb:app_id" content="1386609318277530" /> <meta property="og:image" content="http://www.compareandchoose.com.au/images/Compare-and-Choose-logo.png" /> <meta property="og:image:width" content="313" /> <meta property="og:image:height" content="75" />'; $head = $part->getHead($title,$meta); $header = $part->getHeader('Adventure'); $footer = $part->getFooter(); echo $head; echo $header; ?> <script> function sort() { $('.overlay_wrap').fadeIn(); $('.loader_hotel_page').fadeIn(); } </script> <div class="overlay_wrap" style="display: none;"></div> <div class="loader_hotel_page" style="display: none;"><img src="<?php echo SITE_URL; ?>images/search-loader.gif" alt="searching-records"/></div> <!-----Adventure Listing-----> <div class="container"> <div class="listing"> <div class="row"> <div class="col-xs-12 col-md-3 col-lg-3"> <div class="refine-search travel"> <?php require_once('files/keyword_search.php'); ?> <div class="block"> <div class="block-content"> <div class="block-title">Top Selling Tours & Activities</div> <div class="block-inner"> <div class="top-rated-pic"> <!--<img src="images/small-pic1.png" alt="" />--> </div> <div class="top-topics-sec"> <?php $getcatdataarr = getCategoryDestination($dest_code); $category_arr = $getcatdataarr['data']; $i=1; if($category_arr !="") { foreach ($category_arr as $categoryList) { if($catId == $categoryList['id']) { $image = $categoryList['thumbnailURL']; $groupName = $categoryList['groupName']; ?> <p onclick="sort()"> <strong><?php echo $i;?>.</strong><a href="adventure_list.php?currency_code=<?php echo $currency_code; ?>&dest_code=<?php echo $dest_code;?>&sortOrder=<?php echo $sortOrder;?>&catId=<?php echo $categoryList['id'];?>&country_name=<?php echo $country_name;?>&state_name=<?php echo $state_name;?>&country_dest_id=<?php echo $country_dest_id; ?>&lookupId=<?php echo $lookupId;?>&check_in=<?php echo $check_in;?>&check_out=<?php echo $check_out;?>"><?php echo stripslashes($categoryList['groupName']);?></a> <?php $subcategories_arr = $categoryList['subcategories']; foreach($subcategories_arr as $subcatList) { echo '<br>'; ?> <a href="adventure_list.php?currency_code=<?php echo $currency_code; ?>&dest_code=<?php echo $dest_code;?>&sortOrder=<?php echo $sortOrder;?>&catId=<?php echo $categoryList['id'];?>&subcategoryId=<?php echo $subcatList['subcategoryId'];?>&country_name=<?php echo $country_name;?>&state_name=<?php echo $state_name;?>&country_dest_id=<?php echo $country_dest_id; ?>&lookupId=<?php echo $lookupId;?>&check_in=<?php echo $check_in;?>&check_out=<?php echo $check_out;?>"><?php echo stripslashes($subcatList['subcategoryName']); ?></a> <?php } ?> </p> <?php } else{ ?> <p onclick="sort()"><strong><?php echo $i;?>.</strong><a href="adventure_list.php?currency_code=<?php echo $currency_code; ?>&dest_code=<?php echo $dest_code;?>&sortOrder=<?php echo $sortOrder;?>&catId=<?php echo $categoryList['id'];?>&country_name=<?php echo $country_name;?>&state_name=<?php echo $state_name;?>&country_dest_id=<?php echo $country_dest_id; ?>&lookupId=<?php echo $lookupId;?>&check_in=<?php echo $check_in;?>&check_out=<?php echo $check_out;?>"><?php echo stripslashes($categoryList['groupName']);?></a></p> <?php }$i++;} } ?> </div></div></div></div></div></div> <div class="col-xs-12 col-md-9 col-lg-9"> <div class="travel-main"> <div class="row"> <?php if($image !='') { //$image = 'images/travel-pic.png'; ?> <div class="col-xs-12 col-md-4 col-lg-4"> <!--<img src="<?php echo $image;?>" alt="" />--> </div> <?php } ?> <div class="col-xs-12"> <h1>Things to do in <?php echo stripslashes($country_name);?></h1> <?php if($state_name == '') { $search_name = $country_name; } else{ $search_name = $state_name; } ?> <p>Compare and choose things to do in <?php echo stripslashes($search_name);?></p> <a href="#"><?php echo strtoupper(stripslashes($search_name));?> >></a> <?php if($groupName != '') { echo '<p>'.$groupName.'</p>'; } ?> <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="GET"> <div class="filtering"> <select onchange="this.form.submit();" name="sortOrder"> <option value="TOP_SELLERS" <?php if($sortOrder == 'TOP_SELLERS'){echo 'selected';}?>>Most Popular</option> <option value="REVIEW_AVG_RATING_D" <?php if($sortOrder == 'REVIEW_AVG_RATING_D'){echo 'selected';}?>>Top Rated</option> <option value="PRICE_FROM_A" <?php if($sortOrder == 'PRICE_FROM_A'){echo 'selected';}?>>Price(Low - High)</option> <option value="PRICE_FROM_D" <?php if($sortOrder == 'PRICE_FROM_D'){echo 'selected';}?>>Price(High - Low)</option> </select> <input type="hidden" name="currency_code" value="<?php echo $currency_code;?>" id="currency_code"> <input type="hidden" name="lookupId" value="<?php echo $lookupId;?>" id="lookupId"> <input type="hidden" name="dest_code" value="<?php echo $dest_code;?>" id="dest_code"> <input type="hidden" name="catId" value="<?php echo $catId;?>" id="catId"> <input type="hidden" name="subcategoryId" value="<?php echo $subcategoryId;?>" id="subcategoryId"> <input type="hidden" name="country_name" value="<?php echo $country_name; ?>" id="country_name" > <input type="hidden" name="state_name" value="<?php echo $state_name;?>" id="state_name"> <input type="hidden" name="country_dest_id" value="<?php echo $country_dest_id;?>" id="country_dest_id"> </div> </form> </div><div class="c1"></div></div></div> <?php if($adventure_data_arr != ""){ foreach($adventure_data_arr as $adventureList) { $url = seoUrl($adventureList['title']); if($catId == '') { ?> <div class="travel-list-sec"> <div class="row"> <div class="col-xs-12 col-md-3 col-lg-3 spacal-img"> <?php if($adventureList['specialOfferAvailable'] == 1) {?> <div class="spacal-tag"> <img src="images/specila-tag.png" alt="" /> </div> <?php } ?> <img src="<?php echo $adventureList['thumbnailHiResURL'];?>" alt="" width="166" height="160" /> </div> <div class="col-xs-12 col-md-9 col-lg-9"> <div class="travel-det"> <h2 style="text-transform: uppercase; font: 400 15px 'Open Sans', sans-serif; text-decoration: none;"><a style="color: rgb(103, 191, 54);" href="adventure_details.php?name=<?php echo $url;?>&code=<?php echo $adventureList['code'];?>¤cyCode=<?php echo $adventureList['currencyCode'];?>&lookupId=<?php echo $lookupId;?>&dest_code=<?php echo $dest_code; ?>"><?php echo stripslashes($adventureList['title']);?></a></h2> <p><?php echo stripslashes($adventureList['shortDescription']);?></p> <div class="rating-box"> <div class="ratings"> <?php $rate = $adventureList['rating']; $f= floor($rate); $c = ceil($rate); $cnt = 0; if($rate!="" && $rate!=0) { for($in = 1; $in<=$rate ;$in++) { $cnt++; ?> <img src="images/rating_full.png"> <?php } if($f != $c) { $cnt++; ?> <img src="images/rating_half.png"> <?php } } if($cnt<5) { while($cnt<5) { $cnt++; ?> <img src="images/rating_blank.png"> <?php } } ?> <!--<span class="stars"><?php echo $adventureList['rating']; ?></span>--> </div> <div class="rating-txt"> based on <?php echo $adventureList['reviewCount']; ?> reviews </div> <div class="c1"></div> </div> <div class="price-box"><a href="adventure_details.php?name=<?php echo $url;?>&code=<?php echo $adventureList['code'];?>¤cyCode=<?php echo $adventureList['currencyCode'];?>&lookupId=<?php echo $lookupId;?>&dest_code=<?php echo $dest_code; ?>"> <span style="float: right; margin-right: 1%; padding: 6px 20px; color: white; background-color: rgb(108, 191, 61); text-align: center; font-size:16px; font-weight:400; ">See Details →</span></a> <span class="new_price">Duration :<?php echo stripslashes($adventureList['duration']);?></span><br /> <span class="new_price">From <?php echo stripslashes($adventureList['currencyCode']);?> <?php echo stripslashes($adventureList['priceFormatted']);?></span> <?php if($adventureList['specialOfferAvailable'] == 1) { ?> <div class="original"> <p>Original Price : <?php echo stripslashes($adventureList['rrpformatted']);?></p> </div> <div class="save-price"> <p>Saving Amount : <?php echo stripslashes($adventureList['savingAmountFormated']);?></p> </div> <?php } ?> </div></div></div><div class="c1"></div></div></div> <?php } else { if($subcategoryId == '') { $catgory_arr = $adventureList['catIds']; if(in_array($catId, $catgory_arr)) { ?> <div class="travel-list-sec"> <div class="row"> <div class="col-xs-12 col-md-3 col-lg-3"> <img src="<?php echo $adventureList['thumbnailHiResURL'];?>" alt="" width="166" height="160" /> </div> <div class="col-xs-12 col-md-9 col-lg-9"> <div class="travel-det"> <h1><a href="adventure_details.php?name=<?php echo $url;?>&code=<?php echo $adventureList['code'];?>¤cyCode=<?php echo $adventureList['currencyCode'];?>"><?php echo stripslashes($adventureList['title']);?></a></h1> <p><?php echo stripslashes($adventureList['shortDescription']);?></p> <div class="rating-box"> <span class="stars"><?php echo $adventureList['rating']; ?></span> <div class="rating-txt"> based on <?php echo $adventureList['reviewCount']; ?> reviews </div> <div class="c1"></div> </div> <div class="price-box"> <div class="price">Duration :<?php echo stripslashes($adventureList['duration']);?></div> <div class="price">From <?php echo stripslashes($adventureList['currencyCode']);?> <?php echo stripslashes($adventureList['priceFormatted']);?></div> <?php if($adventureList['specialOfferAvailable'] == 1) { ?> <h3>Special Offer </h3> <p>Original Price : <?php echo stripslashes($adventureList['rrpformatted']);?></p> <p>Saving Amount : <?php echo stripslashes($adventureList['savingAmountFormated']);?></p> <?php } ?> </div></div></div><div class="c1"></div></div></div> <?php } } else{ $sub_catgory_arr = $adventureList['subCatIds']; if(in_array($subcategoryId, $sub_catgory_arr)) { ?> <div class="travel-list-sec"> <div class="row"> <div class="col-xs-12 col-md-3 col-lg-3"> <img src="<?php echo $adventureList['thumbnailHiResURL'];?>" alt="" width="166" height="160" /> </div> <div class="col-xs-12 col-md-9 col-lg-9"> <div class="travel-det"> <h1><a href="adventure_details.php?name=<?php echo $url;?>&code=<?php echo $adventureList['code'];?>¤cyCode=<?php echo $adventureList['currencyCode'];?>"><?php echo stripslashes($adventureList['title']);?></a></h1> <p><?php echo stripslashes($adventureList['shortDescription']);?></p> <div class="rating-box"> <span class="stars"><?php echo $adventureList['rating']; ?></span> <div class="rating-txt"> based on <?php echo $adventureList['reviewCount']; ?> reviews </div> <div class="c1"></div> </div> <div class="price-box"> <div class="price">Duration :<?php echo stripslashes($adventureList['duration']);?></div> <div class="price">From <?php echo stripslashes($adventureList['currencyCode']);?> <?php echo stripslashes($adventureList['priceFormatted']);?></div> <?php if($adventureList['specialOfferAvailable'] == 1) { ?> <h3>Special Offer </h3> <p>Original Price : <?php echo stripslashes($adventureList['rrpformatted']);?></p> <p>Saving Amount : <?php echo stripslashes($adventureList['savingAmountFormated']);?></p> <?php } ?> </div></div></div><div class="c1"></div></div></div> <?php } } } } } ?> </div><div class="breadcrumb-new"> <ul> <li><div itemscope itemtype="http://data-vocabulary.org/Breadcrumb"> <a href="<?php echo SITE_URL;?>" itemprop="url"><span itemprop="title">Home</span></a><span>></span> </div></li> <li><strong>Adventures & Activities in <?php echo $state_name. ',' .$country_name; ?></strong></li> </ul> </div><div class="c1"></div></div></div></div> <?php echo $footer ;?> </body> </html>
Hi All
I am trying to change my website from http to https and I have ran into a problem with one of the scripts producing a none secure http problem
Basically when I check this it shows a none secure error
ERROR
insecure url = http://cache.graphicslib.viator.com/etcetcetc.jpg which needs to be https://cache.graphicslib.viator.com/etcetcetc.jpg
I thinks it is something to do with the array $adventureList array on line 285(not exactly sure, as I didn't write the code and I am not an expert)
So my question is how do I change this to https url
please find attached my page code
thanks in advance all
Alan
-
lol don't blame your phobia
I don't know which piece fo code it is I am not to good with php
but basically its adding ?shoppingfor=UK&shoppingfor=AU when it should only be ?shoppingfor=UK I don't know why its appending all combinations
-
hi are you available for some work, do you have skype
-
http://www.compareandchoose.com.au/video_games?shopingfor=US&shopingfor=US http://www.compareandchoose.com.au/video_games?shopingfor=AU&shopingfor=US http://www.compareandchoose.com.au/video_games?shopingfor=UK&shopingfor=US http://www.compareandchoose.com.au/video_games?shopingfor=US&shopingfor=UK http://www.compareandchoose.com.au/video_games?shopingfor=AU&shopingfor=UK http://www.compareandchoose.com.au/video_games?shopingfor=UK&shopingfor=UK http://www.compareandchoose.com.au/video_games?shopingfor=US&shopingfor=AU http://www.compareandchoose.com.au/video_games?shopingfor=AU&shopingfor=AU http://www.compareandchoose.com.au/video_games?shopingfor=UK&shopingfor=AU when it should only show http://www.compareandchoose.com.au/video_games?shopingfor=US http://www.compareandchoose.com.au/video_games?shopingfor=AU http://www.compareandchoose.com.au/video_games?shopingfor=UK why its appending all combinations I am not sure Please find my 3 page code files it uses
Hi Professionals
I have been doing a site check with MOZ tools and it is showing duplicate page content for all my shopping pages
Basically I have a site where you can compare products for either the UK,US or AU
But it is showing the above results in MOZ
I have tried everything to figure this out, but because it was not written by me I cannot pin point it
Please find attached the 3 pages it utilises
-
thanks Requinix
I am still trying to figure why I cannot get my site fully https enabled. and also the HSTS stuff is a bit over my head.
I have sent you a private PM
thank you
-
RewriteCond %{HTTPS} =on [OR] RewriteCond %{HTTP_HOST} !=www.example.com.au RewriteRule ^ https://www.example.com.au%{REQUEST_URI} [L,R]
hi there Requinix thanks for that and yeah its for a crazy reason because I cannot switch fully to https yet because of a partner link that do not use https yet
could I just change it all to https once they have made the switch hopefully in the next couple of days to force it all to https or would I be better of waiting a few more days for the sake of my seo rankings
would this work to force it back to https
-
RewriteCond %{HTTP_HOST} !^www.example.com.au$ [NC] RewriteCond %{HTTP_HOST} !^https://www.example.com.au$ [NC] RewriteRule ^(.*)$ http://www.example.com.au/$1 [R,L]
Hi All
I have my website 90% working on https, fully working on http and I have managed to redirect from none www to www
What I am looking to do it if the user happens to enter https then make them go to my www version
I have manage to get them to go to my www version if they do not put in www but I am lost in how to redirect them from https to http
here is what I have so far and I just cannot figure it out
thanks
Alan
-
Hi thanks for that I now have SELECT R.RegionName, A.City,A.StateProvince,A.Country,A.CountryName FROM `activepropertylist` A JOIN `RegionEANHotelIDMapping` RM ON A.EANHotelID = RM.EANHotelID JOIN `parentregionlist` R ON RM.RegionID = R.RegionID WHERE MATCH(City, RegionName) AGAINST ('hervey bay' IN BOOLEAN MODE) which works
I have a fulltext index on both the City & RegionName but the trouble is it is taking approx. 7 seconds to return in the backend DB, If I make this live it is more than likely going to be longer which would make the user sit and wait for wuite sometime when searching on an area from the drop down box
Is there a way to speed it up any further?
here is the schema image attached for further information
Basically what I am trying to do is be able to let the user pick from my search box an area, which I am using for auto predict just like expedia do with there auto search for hotels
-
MY QUERY SELECT City, Country FROM `activepropertylist` WHERE MATCH(City) AGAINST ('+"hervey bay"' IN BOOLEAN MODE) GROUP BY City,Countryname,Country union all SELECT RegionName,RegionID FROM `parentregionlist` WHERE MATCH(RegionName) AGAINST ('+"hervey bay"' IN BOOLEAN MODE) RESULTS City,Country Hervey Bay 6053026 Hervey Bay Golf and Country Club 6217212 Hervey Bay Golf and Country Club 6217213 Hervey Bay Historical Village Museum 6217250 Hervey Bay Historical Village Museum 6217253 Hervey Bay Botanic Garden 6217257 Hervey Bay Botanic Garden 6217259 When really it should be RegionName,RegionID Hervey Bay 6053026 Hervey Bay Golf and Country Club 6217212
I have an update. Apparently I only need to look into two tables for the place, so what I am trying to do is find out of the keyword "hervey bay" exists in the activeproperty list table. If it does not does it exist in the parentregionlist table
but I am getting some strange results there seems to be something I am missing as it only shows the two columns from the parentregionlist table when I want to show all 4
here is my query and results
-
SELECT R.RegionName, A.City FROM `activepropertylist` A, `ParentRegionList` R, `RegionEANHotelIDMapping` RM WHERE MATCH(City, RegionName) AGAINST ('hervey bay' IN BOOLEAN MODE) and A.EANHotelID = RM.EANHotelID and RM.RegionID = R.RegionID and R.RegionType = 'Neighborhood'
schema http://developer.ean.com/database-catalogs/relational/geography-data/ book a suit search box example http://www.bookasuite.com/
I am trying to join 3 tables together to get the correct information from expedia tables for my auto drop down box
the schema is here, located in the link and I am looking auto search like book a suite do(link also provided)
problem is I can manage to get the word hervey bay out of the property region list table but the incorrect city comes back from the activeproperylist table(it seems to be showing something from the other table for the city)
here is my query
-
$string = '"' .$q. '*'. '"'; $string = '"' .$q. '*"'; $string = '"' .$q. '"*';
I have tired that and it does not seem to work
I have tried the asterix in three different places as shown
-
$q=$_POST['search']; $string = '"' .$q. '"'; $sql_res=mysql_query("SELECT COUNT( City ) AS Hotel, City, CountryName, Country FROM `activepropertylist` WHERE MATCH(City) AGAINST ('$string' IN BOOLEAN MODE) GROUP BY City,Countryname,Country ORDER BY City LIMIT 10");
hi Jazzman
thanks for this help and yes it is working now I just had to wait for the webserver to refresh but I still have a problem
like you said it is because it is enclosed around double quotes now the word has to be exact so
it will find south shields
it will find newcastle
Newcastle upon
Newcastle upon tyne which is fantastic
but I am looking for it to actually auto predict
EG
if you type in "Newcastle up" or Newcastle upon ty" it will not auto predict "Newcastle upon tyne" until you have typed the full word.
is there a way around this
you can see for your self on my site which is www compareandchoose.com.au/hotel
also here is the updated code
finally thanks again in advance (what I have so far now is good, but would be better if it auto predicted the keyword in question)
-
$q=$_POST['search']; $string = '"' .$q. '"'; echo $sql = "SELECT COUNT( City ) AS Hotel, City, CountryName, Country FROM `activepropertylist` WHERE MATCH(City,Countryname) AGAINST ('+$string' IN BOOLEAN MODE) GROUP BY City,Countryname,Country ORDER BY City";
yes that's what I am doing now and it does not seem to work it just hangs and hangs but does not show anything
even though it works instantly in the database
here is what I have
-
$q=$_POST['search']; $string = '"' .$q. '"'; $sql_res=mysql_query("SELECT COUNT( City ) AS Hotel, City, CountryName, Country FROM `activepropertylist` WHERE MATCH(city,Countryname) AGAINST ('+$string' IN BOOLEAN MODE) GROUP BY City,Countryname,Country ORDER BY City");
SELECT COUNT( City ) AS Hotel, City, CountryName, Country FROM `activepropertylist` WHERE MATCH(City) AGAINST ('+"South shields"' IN BOOLEAN MODE) GROUP BY City,Countryname,Country ORDER BY City LIMIT 15
hi again thanks for that
I have managed to figure the query out in the backend of the database which works for south shields now and is lightening fast
EG
but because of the double quotes around the word south shields I cannot get my head round it in php as my query already has double quotes
in php I am trying this but it does not work
-
SELECT COUNT( City ) AS Hotel, City, CountryName, Country FROM `activepropertylist` WHERE MATCH(city,Countryname) AGAINST ('South shields*' IN BOOLEAN MODE) GROUP BY City,Countryname,Country ORDER BY City LIMIT 15
hi all I have a query against the database table which uses the full text index's and I am limiting this to 15 rows for the ajax
problem is it is returning Africa and other things before south shields
is there something I am missing as I know South shields is in there when scrolling through all the results
here is my query
-
foreach ($array['Itineraries'] as $Itineraries) { foreach($Itineraries['PricingOptions'] as $Option) { echo "<b> Agents: </b> "; // loop over agents for current priceOption foreach($Option['Agents'] as $agentId) { echo $Agents[ $agentId ]['Name']. ', '; // echo the agent name that matches agentId. } echo " <br> price </b>",$Option['Price'] ,"<br />"; } } //Legs foreach ($array['Legs'] as $Leg) { echo "<b> Depart </b> " .$Leg['Departure'], " <b> Arrive </b>",$Leg['Arrival'] ," <b> Direction </b>",$Leg['Directionality'] ," <b> Flight Duration </b>", $Leg['Duration'] , " Minutes, <b> Number of Stops </b>", $Leg['Stops'] , "<br />"; }
I have managed to get a little further if anyone can help me figure out this looping problem
it loops through the agents so agent 1 would match leg 1, agent 2 would match leg 2 and so on but I have this code which loops through all the agents and then all the legs after that but I want to do agent 1, leg1 as stated
Please any help would be a massive hurdle for me
thanks in advance
-
<?php function extractItem(&$array, $itemKey) { $data = array(); foreach($array[$itemKey] as $item) { $Id = $item['Id']; // get the id unset($item['Id']); // remove the id from item array $data[$Id] = $item; // set id as the key } unset($array[$itemKey]); // remove item from array. return $data; // return the new item array } // get the api parametures from setup url $country_code = $_GET['country']; $originplace = $_GET['strtplace']; $destination = $_GET['endplace']; $start_date = $_GET['startdate']; if(isset($_GET['enddate']) && $_GET['enddate']!=""){ $end_date = $_GET['enddate'];} $audult = $_GET['audult']; if(isset($_GET['child']) && $_GET['child']!=""){ $child = $_GET['child'];} if(isset($_GET['infent']) && $_GET['infent']!=""){ $infent = $_GET['infent'];} $class = $_GET['class']; if (!empty($_SERVER['HTTP_CLIENT_IP'])){ $ip=$_SERVER['HTTP_CLIENT_IP'];} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){ $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];} else{$ip=$_SERVER['REMOTE_ADDR'];} $xml = simplexml_load_file("http://www.geoplugin.net/xml.gp?ip=".$ip); $ip_curency = $xml->geoplugin_currencyCode ; $query = "&country=".$country_code; $query .= "¤cy=".$ip_curency; $query .= "&locale=en-GB"; $query .= "&originplace=".$originplace; $query .= "&destinationplace=".$destination; $query .= "&outbounddate=".$start_date; if(isset($end_date) && $end_date!=""){ $query .= "&inbounddate=".$end_date;} $query .= "&adults=".$audult; if(isset($child) && $child!=""){ $query .= "&children=".$child;} if(isset($infent) && $infent!=""){ $query .= "&infants=".$infent;} $query .="&locationschema=iata"; $query .="&cabinclass=".$class; $query .="&pagesize=10"; $apiParamsUrl = "http://partners.api.skyscanner.net/apiservices/pricing/v1.0/".$country_code."?apikey=SECRET".$query.""; $apiParamsStr = parse_url($apiParamsUrl, PHP_URL_QUERY); // get the query string parametures parse_str($apiParamsStr, $apiParamsArray); // parse into an array // the api url. First we need to request for a session $apiSessionUrl = 'http://partners.api.skyscanner.net/apiservices/pricing/v1.0'; //open connection $ch = curl_init(); //set the url, number of POST vars, POST data curl_setopt($ch,CURLOPT_URL, $apiSessionUrl); curl_setopt($ch,CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded', 'Accept: application/json')); // make api return json data curl_setopt($ch,CURLOPT_POST, count($apiParamsArray)); // set how many fiels curl_setopt($ch,CURLOPT_POSTFIELDS, $apiParamsStr); // set the fields // caputre the headers curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_VERBOSE, 1); curl_setopt($ch, CURLOPT_HEADER, 1); //execute post $response = curl_exec($ch); // get the headers $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE); $header = substr($response, 0, $header_size); $body = substr($response, $header_size); //close connection curl_close($ch); // get the api session url preg_match('~Location: ([^\s]+)~', $header, $matches); $apiSessionUrl = $matches[1]; // add on the api key for the session $apiSessionUrl .= '?apiKey=' . $apiParamsArray['apikey']; // get the json data $data = file_get_contents($apiSessionUrl); // decode the json $array = json_decode($data, true); // dump json array printf('<pre>Poll Data %s</pre>', print_r($array, true)); //Itineraries // $Agents = extractItem($array, 'Agents'); // get array of agents //... foreach ($array['Itineraries'] as $Itineraries) { foreach($Itineraries['PricingOptions'] as $Option) { echo "<b> Agents: </b> "; // loop over agents for current priceOption foreach($Option['Agents'] as $agentId) { echo $Agents[ $agentId ]['Name']. ', '; // echo the agent name that matches agentId. } echo " <br> price </b>",$Option['Price'] ,"<br />"; } } //Legs foreach ($array['Legs'] as $Leg) { echo "<b> Depart </b> " .$Leg['Departure'], " <b> Arrive </b>",$Leg['Arrival'] ," <b> Flight Duration </b>", $Leg['Duration'] , " Minutes, <b> Number of Stops </b>", $Leg['Stops'] , "<br />"; } //Carriers foreach ($array['Carriers'] as $Carrier) { echo "<b> Name </b> " .$Carrier['Name'], " <b> Image </b>", $Carrier['ImageUrl'] ,"<br />"; } //Places foreach ($array['Places'] as $Place) { echo "<b> Place Code </b> " .$Place['Code'], " <b> Place Name </b>",$Place['Name'] ,"<br />"; } ?>
Hi all
I bit of an update
I have managed to extract a bit more information at the bottom as you can see at the bottom of the array.
2 things I still seem t be struggling with are
1: the function call I have commented out because I cannot figure why its not working
2: I obviously want to present this nicely EG
6:35 am - 10:40 am 21hrs 5 mins, 1 stop Price $2560.24
BNE LAX SYD
Brisbane Los Angeles Sydney
something like the way expedia do it which I have attached an example
please see my updated code, im a bit lost with it now
thanks all
you can also see working text here dev DOT compareandchoose DOT com DOT au/sky/Alan_test
I hope I have provided enough information
-
<?php function extractItem(&$array, $itemKey) { $data = array(); foreach($array[$itemKey] as $item) { $Id = $item['Id']; // get the id unset($item['Id']); // remove the id from item array $data[$Id] = $item; // set id as the key } unset($array[$itemKey]); // remove item from array. return $data; // return the new item array } // get the api parametures from setup url $country_code = $_GET['country']; $originplace = $_GET['strtplace']; $destination = $_GET['endplace']; $start_date = $_GET['startdate']; if(isset($_GET['enddate']) && $_GET['enddate']!=""){ $end_date = $_GET['enddate'];} $audult = $_GET['audult']; if(isset($_GET['child']) && $_GET['child']!=""){ $child = $_GET['child'];} if(isset($_GET['infent']) && $_GET['infent']!=""){ $infent = $_GET['infent'];} $class = $_GET['class']; if (!empty($_SERVER['HTTP_CLIENT_IP'])){ $ip=$_SERVER['HTTP_CLIENT_IP'];} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){ $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];} else{$ip=$_SERVER['REMOTE_ADDR'];} $xml = simplexml_load_file("http://www.geoplugin.net/xml.gp?ip=".$ip); $ip_curency = $xml->geoplugin_currencyCode ; $query = "&country=".$country_code; $query .= "¤cy=".$ip_curency; $query .= "&locale=en-GB"; $query .= "&originplace=".$originplace; $query .= "&destinationplace=".$destination; $query .= "&outbounddate=".$start_date; if(isset($end_date) && $end_date!=""){ $query .= "&inbounddate=".$end_date;} $query .= "&adults=".$audult; if(isset($child) && $child!=""){ $query .= "&children=".$child;} if(isset($infent) && $infent!=""){ $query .= "&infants=".$infent;} $query .="&locationschema=iata"; $query .="&cabinclass=".$class; $query .="&pagesize=10"; $apiParamsUrl = "http://partners.api.skyscanner.net/apiservices/pricing/v1.0/".$country_code."?apikey=SECRET".$query.""; $apiParamsStr = parse_url($apiParamsUrl, PHP_URL_QUERY); // get the query string parametures parse_str($apiParamsStr, $apiParamsArray); // parse into an array // the api url. First we need to request for a session $apiSessionUrl = 'http://partners.api.skyscanner.net/apiservices/pricing/v1.0'; //open connection $ch = curl_init(); //set the url, number of POST vars, POST data curl_setopt($ch,CURLOPT_URL, $apiSessionUrl); curl_setopt($ch,CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded', 'Accept: application/json')); // make api return json data curl_setopt($ch,CURLOPT_POST, count($apiParamsArray)); // set how many fiels curl_setopt($ch,CURLOPT_POSTFIELDS, $apiParamsStr); // set the fields // caputre the headers curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_VERBOSE, 1); curl_setopt($ch, CURLOPT_HEADER, 1); //execute post $response = curl_exec($ch); // get the headers $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE); $header = substr($response, 0, $header_size); $body = substr($response, $header_size); //close connection curl_close($ch); // get the api session url preg_match('~Location: ([^\s]+)~', $header, $matches); $apiSessionUrl = $matches[1]; // add on the api key for the session $apiSessionUrl .= '?apiKey=' . $apiParamsArray['apikey']; // get the json data $data = file_get_contents($apiSessionUrl); // decode the json $array = json_decode($data, true); // dump json array printf('<pre>Poll Data %s</pre>', print_r($array, true)); //Itineraries $Agents = extractItem($array, 'Agents'); // get array of agents //... foreach ($array['Itineraries'] as $Itineraries) { foreach($Itineraries['PricingOptions'] as $Option) { echo "<b> Agents: </b> "; // loop over agents for current priceOption foreach($Option['Agents'] as $agentId) { echo $Agents[ $agentId ]['Name']. ', '; // echo the agent name that matches agentId. } echo " <br> price </b>",$Option['Price'] ,"<br />"; } } //Legs foreach ($array['Legs'] as $Leg) { echo "<b> Departure </b> " .$Leg['Departure'], " <br> <b>Arrival </b>",$Leg['Arrival'] ,"<br />"; } //Carriers foreach ($array['Carriers'] as $Carrier) { echo "<b> Name </b> " .$Carrier['Name'], " <br> Image </b>",$Carrier['ImageUrl'] ,"<br />"; } //Places foreach ($array['Places'] as $Place) { echo "<b> Code </b> " .$Place['Code'], " <br> Name </b>",$Place['Name'] ,"<br />"; } ?>
Hi professionals
I am trying to extract the correct information from a flights API
It was working until I added in the function.
Now I just see the word Poll Data on my screen
is there something I am missing here (code attached)
Thanks
URLs to long error in moz tools
in PHP Coding Help
Posted
yes looking into this I am not sure if it can be done
I was thinking could we display or re-write to show www.myurl.com.au/hotel_name/test-hotel but still pass the whole url with the deep link I am not to sure
here is our webpage code with the API credentials taken out