Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <script>
- function loadXMLDoc(){
- var xmlhttp = new XMLHttpRequest();
- xmlhttp.onreadystatechange=function() {
- if (xmlhttp.readyState==4 && xmlhttp.status==200) {
- document.getElementById("chatFenster").innerHTML=xmlhttp.responseText;
- }
- }
- xmlhttp.open("GET","refresh.php",true);
- xmlhttp.send();
- }
- setInterval(loadXMLDoc, 1500);
- function clearText() {
- document.getElementById('text').value = '';
- }
- </script>
- </head>
- <body onload="loadXMLDoc();" style="text-align: center;">
- <?php
- include("helper.php");
- $database = connect();
- if (isset ($_SESSION['userID'])){
- $user = getUser($database, $_SESSION['userID']);
- }
- if (isset($user)){
- if ($user != NULL){
- if (isset ($_POST['klasse'])){
- $_SESSION['klasse'] = $_POST['klasse'];
- }
- ?>
- <h2>Chat</h2>
- <div id="chatFenster" style="overflow:auto; height:700px; width:500px;text-align: left; margin-left: auto; margin-right: auto;">
- </div>
- <br>
- <br>
- <form name="senden" action="senden.php" method="post">
- <textarea name="text" id="text" style='height:30px; width:200px;'></textarea>
- <input type="submit" name="senden" value="senden" style='height:30px; width:70px; position: relative; top: -7px;'>
- </form>
- <form action="upload.php" enctype="multipart/form-data" method="post">
- <input type="file" name="file">
- <input type="submit" name="upload">
- </form>
- <button onclick="loadXMLDoc();">Refresh</button>
- <button onclick="clearText()">clear</button>
- <?php
- } else {
- echo "Du hast nicht die Befugnis!";
- header("refresh:5;index.php");
- }
- } else {
- echo "Du hast nicht die Befugnis!";
- header("refresh:5;index.php");
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement