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

  • Home
  • SEARCH
  • 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 8472725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T17:09:18+00:00 2026-06-10T17:09:18+00:00

I load data from an xml file (file.xml) whose content is dynamic, but the

  • 0

I load data from an xml file (file.xml) whose content is dynamic, but the problem the content in my table is the same but I see in my file the content changes. As if the loading is done once.

Please help.

Thank you

A peace of code : (sorry if you find a problem in my code)

   window.setInterval(function() { 
        <?php 
        $xml = simplexml_load_file("file.xml");
        foreach($xml as $node)
        {
            $name = "";
            $value = -1;

            foreach($node->attributes() as $a => $b) {
                if($a == "name")
                {
                    $name = (string)$b;
                }
                else if($a == "value")
                {
                $value = (string)$b;
                }
            }

            $vars[$name] = $value;
        }

        $json = json_encode($vars);
        ?>

        //// code to show the result in my table
    }, 1000);
  • 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-10T17:09:20+00:00Added an answer on June 10, 2026 at 5:09 pm

    PHP stands for PRE hypertext processing, meaning the PHP is generated first and foremost.

    Also you need to understand that PHP is processed on the server side while javascript is processed on the client side.

    So when your PHP function is run, it will load the file as intended but will only load it once. You need to put your PHP function in a .php file of its own and then use an AJAX request every second to get the updated table.

    Example in jQuery, given your PHP code is in loadtable.php

    window.setInterval(function() {
        $.ajax({
            method : "GET",
            url : "loadtable.php",
            success : function(data){
                //set the body of the page to the result of the PHP file.
                $("body").html(data);
            }
        });
    }, 1000);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to load data from xml-file with TinyXML (c++). int height = rootElem->attrib<int>(height,
How can I load data from an xml file into solr using the solrj
How can I load data from an xml file into a DataTable with a
I want to read data from XML file but it showing the following errors:
I am loading a huge amount of data from an XML file. This data
I used RestKit to load XML data from a resource. That worked perfect, but
Possible Duplicate: I want to load the data from XML file and show in
I wan't to load some data from my XML file using this function: public
I want to load data from an XML file and assign that data to
I'm trying to load data from an xml file, load them in arrays and

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.