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 7065745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:59:37+00:00 2026-05-28T04:59:37+00:00

I’m currently developing a webtool for a game called ‘Eve Online’. This game has

  • 0

I’m currently developing a webtool for a game called ‘Eve Online’.
This game has an ingame browser and support fully all HTML, CSS, PHP and Javascript languages without any problem.

For this project I’m using PHP and Ajax because of the fact that I don’t want to refresh my page each time. I would like to refresh it automatically every 5 seconds.

So to do a small test I wanted to show the server time and refresh that every second.
This is my code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="css/style.css" rel="stylesheet" type="text/css"/>
<title>Eve Online - Tactical Fleet Tool</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript">
    function loadXmlHttp(url, id) {
        var f = this;
        f.xmlHttp = null;

        if (window.XMLHttpRequest) // && !f.ie||/^http/.test(window.location.href)
            f.xmlHttp = new XMLHttpRequest(); // Firefox, Opera 8.0+, Safari, others, IE 7+ when live - this is the standard method
        else if (/(object)|(function)/.test(typeof createRequest))
            f.xmlHttp = createRequest(); // ICEBrowser, perhaps others
        else {
            f.xmlHttp = null;
        }

        if(f.xmlHttp != null){
            f.el = document.getElementById(id);
            f.xmlHttp.open("POST",url,true);
            f.xmlHttp.onreadystatechange = function(){
                            f.stateChanged();
            };
            f.xmlHttp.send(null);
        }
    }


    loadXmlHttp.prototype.stateChanged=function () {
        if (this.xmlHttp.readyState == 4 && (this.xmlHttp.status == 200 || !/^http/.test(window.location.href)))
            this.el.innerHTML = this.xmlHttp.responseText;
    }

    var requestTime = function(){
        new loadXmlHttp('member.php', 'timeDiv');
        setInterval(function(){
            new loadXmlHttp('member.php?t=' + new Date().getTime(), 'timeDiv');
        }, 1000);
    }

    if (window.addEventListener)
     window.addEventListener('load', requestTime, false);
    else if (window.attachEvent)
     window.attachEvent('onload', requestTime);

</script>
</head>
<body>
<div id="header">
    <div id="headercontainer">
        <a href="http://www.eveonline.com">
            <img style="border:0px;" alt="EVE Online" src="images/header.jpg"/>
        </a>
    </div>
</div>
<?php
    session_start();
    if($_SESSION['username'])
    {

        if($_SERVER['HTTP_EVE_TRUSTED'] == 'No')
            header('eve.trustMe:http://localhost/EveOnline_FleetManager/::Please trust me!');
        else
        {
            $charname =  $_SERVER['HTTP_EVE_CHARNAME'];
?>
<div id="menu">
    <ul>
        <li>You are currently logged in with: <?php echo $charname ?></li>
        <li>Add Character to account</li>
        <li>Make a fleet</li>
        <li>Edit Account Details</li>
        <li>Logout</li>
    </ul>
</div>

<div id='timeDiv'>
    <?php include "test.php"; ?>
</div>

<div id='overview'>
<h2 style="text-align:center;">Fleet Overview</h2>
<table id='fleet_table' border="1" align="center">
<tr id='fleet_table_header'>
    <th>Fleetname</th>
    <th>Started by Pilot</th>
    <th>Join</th>
</tr>
<tr id='fleet_table_data'>
    <td>iLLogicaL Pwn Fleet</td>
    <td>21:00 09/01/2012 by iLLogicaL</td>
    <td>Join</td>
</tr>
</table>
</div>
<?php 
        }
    }
    else
        die("You must be logged in!");
?>
</body>
</html>

In my test.php page I only have an echo which returns my server time.
This bit of code gives me following result.

http://i42.photobucket.com/albums/e326/kartingfreak/20120116201252.jpg

So the server time is updating correctly but as you can see apperently other div’s are being refresh’ed too and are being placed inside that ‘timeDiv’.

What am I doing wrong?

Thx 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-05-28T04:59:38+00:00Added an answer on May 28, 2026 at 4:59 am

    As I’m reading it, it looks like you’re loading member.php from member.php?

    If you create for example time.php which only outputs the time (and nothing else), and then load that using AJAX, does that work?

    Edit: Looks like you already have a file that returns time (test.php) – would loading that file in the ajax call work?

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
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
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
Basically, what I'm trying to create is a page of div tags, each has
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
I am currently running into a problem where an element is coming back from

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.