Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9083251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T20:44:05+00:00 2026-06-16T20:44:05+00:00

Hi I’m having some problems making my function structure. Would appreciate any help. First

  • 0

Hi I’m having some problems making my function structure. Would appreciate any help.

First this function should delete map markers once OnChange event is triggered from index.php.
And send post values to xmlmapquery.php for data retrieval.
once retrieved, The data should be stored back to my index.php in <div id='content'>

function filter()
{ 
   for (var i = 0; i < markersArray.length; i++ ) {
      markersArray[i].setMap(null);
   }
   markersArray.length = 0;

   var lgu = $('#lgu').val();
   var category = $('#category').val();
   var type = $('#type').val();
   $.get('xmlmapquery.php', { filter: lgu, filter2: category, filter3: type},function(data){
        $('#content').text(data);
   )};
};

Now this is xmlmapquery.php

<?php  
  include('connection_db.php');
  // Start XML file, create parent node
  $dom = new DOMDocument("1.0");
  $node = $dom->createElement("markers");
  $parnode = $dom->appendChild($node); 

  if(isset($_POST['filter']) && isset($_POST['filter2']) && isset($_POST['filter3'])){
     $query = "SELECT * FROM markers WHERE type='".$_POST['filter']."' and type='".$_POST['filter2']."'
                                        and type='".$_POST['filter3']."'";
  } 
  // Select all the rows in the markers table
  $result = mysql_query($query);
  if (!$result) {  
     die('Invalid query: ' . mysql_error());
  } 

  header("Content-type: text/xml"); 

  // Iterate through the rows, adding XML nodes for each
  while ($row = @mysql_fetch_assoc($result)){  
    // ADD TO XML DOCUMENT NODE  
    $node = $dom->createElement("marker");  
    $newnode = $parnode->appendChild($node);   
    $newnode->setAttribute("name",$row['name']);
    $newnode->setAttribute("address", $row['address']);  
    $newnode->setAttribute("lat", $row['lat']);  
    $newnode->setAttribute("lng", $row['lng']);  
    $newnode->setAttribute("type", $row['type']);
  } 
  echo $dom->saveXML();
?>

Would appreciate help on this. currently the function is NOT working even deleting the markers is not working. Once i get this thing working I will add more commands to the function that would get data and create new markers for my map. Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T20:44:05+00:00Added an answer on June 16, 2026 at 8:44 pm

    Suppose your script logic is ok, and no die() or other php methods are returning null or false (anyway you should see in your browser console).

    Things to do are:

    1 – check firebug/chrome/browser console when launching request (if the request is hidden in some way use the “save” request method in console to check that)

    2 – use var_dump($dom->saveXML()); instead of echo $dom->saveXML();

    3 – check server/php logs when possible

    4 – be sure your request uirl is complete and working and i’m referring to $.get('xmlmapquery.php');

    if you follow this line of debugging, unless ghosts doesn’t exists, you will be able to run your script easly.

    Hope it will help

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I'm making a simple page using Google Maps API 3. My first. One marker
I have just tried to save a simple *.rtf file with some websites and
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I would like to run a str_replace or preg_replace which looks for certain words

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.