Apr 19 2007

Prototype ajax updater response

Tag: Phpberrisch @ 12:10 pm

Very important: for each php response add this line - with the appropriate charset

header('Content-type: text/html; charset=iso-8859-1');
date("Y-m-d H:i:s");

Apr 12 2007

MySql result to table (with header)

Tag: Phpberrisch @ 1:04 pm
echo '<table>';
$request = "SELECT id, title, name, adr, ulf FROM truc";
$result  = mysql_query($request);
echo '<tr>';
for($i = 0; $i < mysql_num_fields($result); $i++) {
	echo '<td>';
	echo mysql_field_name($result,$i);
	echo '</td>';
}
echo '</tr>';
while($line = mysql_fetch_assoc($result)){
	echo '<tr>';
	foreach ($line as $item) {
		echo '<td>';
		echo $item;
		echo '</td>';
	}
	echo '</tr>';
}
echo '</table>';

Mar 30 2007

Header XML

Tag: Phpberrisch @ 10:33 am
header("Content-Type: text/xml");
echo '<?xml version="1.0" encoding="utf-8" ?>';

Next Page »