<head>
<title></title>
<meta name="description" content="">
<meta name="keywords" content="">
<script language="javascript">
textbox.focus
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#00CCFF" background="blÄ.jpg">
<form action="<?=$PHP_SELF;?>" method="post">
<P>
<LABEL for="list"> </LABEL>
<textarea name="list" rows="15" cols="50" READONLY>
<?php
if ($textbox != "") {
print $textbox."\n".$list;
} else {
print $list;
}
?>
</textarea>
<LABEL for="listnavn"> </LABEL>
<textarea name="listnavn" rows="15" cols="15" READONLY></textarea><br>
<LABEL for="textbox"></LABEL>
</P>
<input type="text" name="textbox" size=62>
<input type="submit" value="text">
</FORM>
<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
// always modified
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache"); // HTTP/1.0
$tekst=urldecode($tekst);
echo($tekst);
$fp = fsockopen ("192.168.1.3", 1024, $errno, $errstr, 10000);
socket_set_blocking ($this->connection, false);
if (!$fp) {
echo "$errstr ($errno)<br>\n";
} else {
fputs ($fp, "USER:$login1\r\n");
//fputs ($fp, $textbox\r\n");
while (!feof($fp))
{
$tekst=$tekst.fgets($fp,200);
echo($tekst);
}
fclose($fp);
}
?>
</body>
i have a big problem. this is my client program for a chat program. the server is runing NON-blocking. but me problem is that my client program will not get out of the while loop until i break it, and then the connection is lost. and if i dont break it, then the new page with the chat on, will not pop up. plz help
P.s this is my first program in PhP