RE: Updating an open page with PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[snip]
Yes, but then the user would always have to reload the imbedded frame.
[/snip]

Actually you could use meta-refresh for the imbedded frame. I have done
something similar for a notes update in a ticketing system. Also, you
could start an endless loop in the imbedded frame. Here is an example
(also uses JavaScript for the form submission) which came from a test
that I conducted.

<?php
/*
 * a20050216jb
 */
$dbc = mysql_connect('server', 'user', 'password');

for($i = 0; $i < 256; $i++){
  $spaces .= " ";
} 
 
while(TRUE){
	$getNotesCount = "SELECT COUNT(*) AS entries FROM test.tblTNotes
";
	if(!($dbNotesCount = mysql_query($getNotesCount, $dbc))){
		echo mysql_error() . "\n";
		exit();
	}
	$value = mysql_fetch_array($dbNotesCount);
	$newValue = $value['entries'];
	if(!(isset($currentValue)) || ($currentValue != $newValue)){
		$currentValue = $newValue;
	?>
		<form name="foo" action="stateTestData.php"
method="POST" target="bottomFrame">
		</form>
		<script language="javascript">
		foo.submit();
		</script>
	<?php
		flush();
		ob_end_flush();		
	}
	sleep(10);
} 
?>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux