Пример #1
0
<?php

if (!empty($_POST['tekst'])) {
    require_once 'funkcje/czatuj.php';
    czatuj($User['login'], $_POST['tekst']);
}
?>
<div class="post" id="post-18">
		<h2>Czat</h2>
		w wersji demo mocno spowolniono odświeżanie się czatu (tylko co minutę)<hr/>
		<div class="entry">
			<script type="text/javascript" src="www/mintAjax.js"></script>
			<script type="text/javascript">
				<!--
				function refresh() {
				var req = mint.Request();
				req.OnSuccess = function () { document.getElementById("czat").innerHTML = this.responseText;},
				req.OnError = function () {document.getElementById("czat").innerHTML = "Wystąpił błąd !!! </br>" + this.responseText + "</br>" + req.xmlHttpRequest.statusText ;}
				req.Send ("czat.php");
				}
				var ginter=setInterval(refresh, 60000); 
			// -->
			</script>
			<form action='?akcja=czat' method='post'>
			<textarea name="tekst" cols=80 rows=2></textarea><br/>
			<input type='submit' value='powiedz'/>
			</form>
			<br/>
			<br/>
			<div id='czat'>
			<?php 
Пример #2
0
<?php

if (!empty($_POST['tekst'])) {
    fx('czatuj');
    czatuj($gracz['login'], $_POST['tekst']);
}
?>

		<h2>Czat</h2><hr/>
		<p>
		w wersji demo mocno spowolniono odświeżanie się czatu (tylko co minutę)<hr/>
		
			<script type="text/javascript" src="www/mintAjax.js"></script>
			<script type="text/javascript">
				<!--
				function refresh() {
				var req = mint.Request();
				req.OnSuccess = function () { document.getElementById("czat").innerHTML = this.responseText;},
				req.OnError = function () {document.getElementById("czat").innerHTML = "Wystąpił błąd !!! </br>" + this.responseText + "</br>" + req.xmlHttpRequest.statusText ;}
				req.Send ("czat.php");
				}
				var ginter=setInterval(refresh, 60000); 
			// -->
			</script>
			<form action='?akcja=czat' method='post'>
			<textarea name="tekst" cols=50 rows=2></textarea><br/>
			<input type='submit' value='powiedz'/>
			</form>
			<br/>
			<br/>
			<div id='czat'>