Hallo zusammen,
Ich bin an der Versuchung eine PHP Abfrage alle paar sekunden durchzuführen.
Dies Funktioniert eigentlich auch schon ziemlich gut:
load.php
test.php:
Nur ist das problem, dass die seite index.php nicht als neue Seite geöffnet wird sonder nur in der Seite seite load.php "included" wird
Also eigentlich möchte ich das eine neue Seite geladen wird
Ich bin an der Versuchung eine PHP Abfrage alle paar sekunden durchzuführen.
Dies Funktioniert eigentlich auch schon ziemlich gut:
load.php
HTML-Quellcode
- <!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>
- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"></script>
- <script>
- setInterval(
- function()
- {
- $('#content').fadeOut('slow').load('test.php').fadeIn("slow");}, 3000);
- </script>
- <title>Auto Load</title>
- </head>
- <body>
- <div id="content" style="background-color:#ffffcc;font-size:24px;font-family:'Georgia', Times New Roman, Times, serif;font-weight:bold;width:600px;margin:auto 10px;"> Please wait .. </div>
- </body>
- <html>
test.php:
PHP-Quellcode
- <?php
- ini_set('display_errors', true);
- include('db_connect_i.inc.php');
- $erledigt = 1;
- $sql = "SELECT *
- FROM gestempelt" ;
- $erg = $db->query ($sql) or die ("Fehlermeldung=".$db->error());
- while(($row = $erg->fetch_assoc()) !== Null){
- $a=$row["id"];
- $b=$row["uid"];
- $c=$row["zeit"];
- $d=$row["neu"];
- }
- if ($d == 0){
- $stmt = $db->prepare("UPDATE gestempelt SET neu = ? WHERE id = ?");
- $stmt->bind_param('si',$erledigt,
- $a
- );
- $stmt->execute();
- $stmt->close();
- Header('Location: index.php?uid=' . $b . '');
- }
- ?>
Nur ist das problem, dass die seite index.php nicht als neue Seite geöffnet wird sonder nur in der Seite seite load.php "included" wird
Also eigentlich möchte ich das eine neue Seite geladen wird