for a schoolproject I am making a forum that has to work synchronized because its goal is having a discussion in real time for an arranged period. So it's important to see on each single moment new updates.
For now my forum looks good but it has one big problem. When I am logged in, I can see immediately my posts. But when someone else posted something in between, I can only see it when I post a new reaction or doing a manual page refresh. Of course this is very irritating.
I know that it is possible to fix that with AJAX and/or Javascript but the problem is that my forum has to work without this two things. So I was looking for solutions but I didn't find what I looked for.
Every answer I found they use Javasript or Ajax. When I was writing my question here, I founded another simular one that looks the same ("Refresh a Div, Table or TR without reloading page and without using Ajax"), but when I looked in the answer, I saw Javasript. So it still isn't what I looking for.
I have also tried to put the code, for seeing the updates, on an other place in my code. but even then it doesn't work. I hope that someone can help me to make it good.
Kirsten
Ps: sorry if there are some little faults in my English
include('jeugdhulp_2-0_connectie.php');
include('klasses/Reacties.class.php');
$reactie = new Reacties();
$stellingen = $reactie->ToonStelling();
//$recenteactiviteiten = $reactie->ToonRecenteReacties();
if(!empty($_POST['tekst_gebruiker']))
{
$reactie->Reactie = $_POST['tekst_gebruiker'];
$reactie->ID = $_SESSION["gebruikersid"];
try
{
$reactie->Save();
//$reactie->ToonStelling();
//$feedback = "Uw gegevens werden bewaard!";
}
catch(Exception $e)
{
$feedback = $e->getMessage();
}
}
else
{
$feedback = "";
}
//altijd recente reacties laten zien
$recenteactiviteiten = $reactie->ToonRecenteReacties();
Absent using Ajax and Javascript HTML is static and will only show new data when the page is reloaded. So in short you can't
If you hate the javascript use <iframe>
and meta refresh
you can use meta refresh (within a frame eventually) but it won't be real time; meta-refresh uses a timer to automatically call for the page
edit: with ajax it won't be real time either unless you "listen" for updates pushed by the server through the connection you make back to the server; otherwise you'd be using a timer, still
This is somehow similar to the way Facebook is doing, which is pushing the data to users instead of waiting for the users to reload the page. I have some very interesting sources for you to discover, maybe you will find something meaningful there :)
Have you ever heard of Comet programming before? It helps you to push the data towards users " without the browser explicitly requesting it".
Ape project is also a useful place for you to look at. It facilitates Ajax Push for realtime web, which is what you are looking for.
Happy discovering and keep in mind that without Javascript and AJAX, nothing you can do to make your forum being realtime.