Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by bravo14

  1. I have added the &c='+country that is where the problem is occurring, in this line var url = query + '&c='+country;
  2. Hi I am trying to pass 2 variables to a URL using typeahead, but the URL that it gerjneates is incorrectly formatted. The code I am using on the function is $('#txtLocation').typeahead({ source: function (query, process) { var country = $('#txtCountry').val(); var url = query + '&c='+country; //var uri = encodeURI(url); //alert(uri); return $.get('ajax/search_locations.php', { query: encodeURI(url) }, function (data) { data = $.parseJSON(data); return process(data);
  3. Hi all I am trying to get the lat and long properties from the googlemaps geocoding api. $xml=simplexml_load_file($url); if ($xml === false) { echo "Failed loading XML\n"; foreach(libxml_get_errors() as $error) { echo "\t", $error->message; } } else{ $path = $xml->xpath( "/GeocodeResponse/result/geometry/location"); $lat = $path->lat; $lng = $path->lng; echo $lat; echo $lng; $sql1 = "UPDATE tbl_clubs set lat='$lat',lng='$lng' where club_id =$id"; echo $sql1; $res
  4. Hi all I am having problems with a script that uploads photo and adds watermarks to them. Whenever I try and upload a photo I get the following error Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 24576 bytes) in /home/sites/4a/1/13cb47e429/public_html/control/photos/processProduct.php on line 163 Line 163 is $image = imagecreatefromstring(file_get_contents($photo)); Let me know if you need the entire function for this and I will add it, but not sure what is wrong with the script, I have never seen this error before.
  5. Hi I am using the javascript below to carry put an ajax call. $('#tokenfield') .on('tokenfield:createdtoken', function (e) { $.ajax({ url: 'processProduct.php?action=addTag', type: 'post', data: {tag:e.attrs.value ,photo:83}, }); }); .tokenfield({ autocomplete: { source: function (request, response) { jQuery.get("processProduct.php?action=getTags", { query: request.term }, function (data) { data = $.parseJSON(data); response(data); }); }, delay: 100 }, showAutocompleteOnFocus: true }); When the page loads I get the following error in the console yntaxError: expec
  6. Hi I am trying to use SimpleXML to parse the wordpress export XML file, but when parsing it I am not able to view all elements of the file. Each 'item' is made up in the XML as follows <item> <title></title> <link>http://www.dannykingracing.co.uk/?p=396</link> <pubDate>Fri, 21 Oct 2016 10:48:48 +0000</pubDate> <dc:creator><![CDATA[@dmin]]></dc:creator> <guid isPermaLink="false"></guid> <description></desc
  7. Hi I have an XML file listing vehicle details, one record looks like <VehicleDataFeed> <VehicleRecord> <GUID>0dc50ce0-32e2-4785-a6a5-266071944792</GUID> <ReferenceID>0002878523</ReferenceID> <CompanyID>2</CompanyID> <DivisionID>2</DivisionID> <BranchID>2</BranchID> <Location>Auction</Location> <VehicleRecordID>890058</VehicleRecordID> <StockNumber>BU101206</StockNumber> <RegistrationNumber>SL61 TUA</RegistrationNumber> <RegistrationDate>2011-09-29T00:00:00+01
  8. Hi I am using a datetimepicker in bootstrap and the date format being displayed is dd/mm/yyyy H:i I need it converted to yyyy-mm-dd H:i The code I am using is $newsdate = strtotime($_POST['txtDate']); $news_date = date('Y-m-d H:i:s', $newsdate); However on date like to day 10th April which I would have as 10/04/2017 the code is converting that to 2017-10-04 instead of 2017-04-10 How can I get the dates converted correctly?
  9. Hi I have a mysql query that generates a league table based on wins, losses and draws etc, but also points difference between how many they score and how many are scored against them. The query works except for the points difference part, the offending part of the query is shown below @F:=SUM(IF(tbl_clubs.club_id = tbl_fixtures.away,tbl_fixtures.awayscore,0)) + SUM(IF(tbl_clubs.club_id = tbl_fixtures.home,tbl_fixtures.homescore,0)) as `F`, @A:=SUM(IF(tbl_clubs.club_id = tbl_fixtures.home,tbl_fixtures.awayscore,0)) + SUM(IF(tbl_clubs.club_id = tbl_fixtures.away,tbl_fixtures.home
  10. Hi all I have a xml file that builds a league table, but want to provide other sites with access to it for a charge. Is there a way I can check the domain using the xml file has permission to do so? I intended on keeping a key in a database with the URL but how can I get the URL using the xml file?
  11. Think part of my problem is on some parts of the menu I will need to get menu options from a different table as well as the pages menu if that makes sense.
  12. Hi all Trying to build a multi level nav for bootstrap from a database below is the code I am using <?php $table = 'tbl_pages_'.$lang; $sql = "SELECT * FROM $table where parent_id = 0 and visible = 1 order by `order` asc"; //echo $sql; $result = mysqli_query($dbConn,$sql) or die(mysqli_error($dbConn)); if(mysqli_num_rows($result)>0){ ?> <nav class="navbar navbar-default navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" dat
  13. HI all Probable a very simple answer but I am struggling, I have a .htaccess file with specific rules, but I also want a line on there for any pages that aren't captuured by the previous rules. I currently have the following .htaccess RewriteRule ^news$ news.php [L] RewriteRule ^gallery$ gallery.php[L] RewriteRule ^fixtures$ fixtures.php [L] RewriteRule ^about-us$ profile.php [L] RewriteRule ^sponsors$ sponsors.php [L] RewriteRule ^contact$ contact-us.php [L] RewriteRule ^gallery/([^/\.]+)/([^/\.]+)?$ gallery.php?id=$1&identifier=$2 [L] RewriteRule ^news/([^/\.]+)/([^/\.]+)?
  14. Hi all I am trying to update field values using AJAX and json. the ajax call is made using this code <script type="text/javascript"> $(document).ready(function() { $("#cboShipping").change(function() { var data = { subTotal:25, discount:0, shippingOption: $('#cboShipping').val() } $.ajax({ type:"POST", url:"library/setPostage.php", data: data, dataType:'json', success: function(data){
  15. This is one of the functions I have used with the same result http://phppot.com/php/php-time-ago-function/ I will look at DateTime
  16. Hi all Trying to use a timeago function, however for a date and time for today of 2016-07-02 16:41:48 it is showing at 46 years ago. below is the function function ago($timestamp) { $diff = time() - (int)$timestamp; //echo $diff; if ($diff == 0) return 'just now'; $intervals = array ( 1 => array('year', 31556926), $diff < 31556926 => array('month', 2628000), $diff < 2629744 => array('week', 604800), $diff < 604800 => array('day', 86400), $diff <
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.