| Beispiel für Xajax Checkboxen deren Zustand bei Klick sofort in der Datenbank hinterlegt werden ohne "submit" |
<?php require ('xajax/xajax_core/xajax.inc.php'); require('detect.php'); $xajax = new xajax(); $xajax->register(XAJAX_FUNCTION,"update_color_box"); |
//============================================================================== // Ajax function update_color_box($nr, $action){ $link = mysql_connect('localhost', USER, 'PASS'); $nr = substr($nr,1); if( $action=="SET"){ $Response = new xajaxResponse(); |
//------------------------------------------------------------------------------- function check_onoff($id){ $link = mysql_connect('localhost', USER, PASS'); if( $row['zustand']==1){ } |
| HTML |
<a onclick="javascript:flip_checkbox('color_1');" href="#null"><img src="xajax/bilder/<?php echo check_onoff(1);?>" name="color_1" width="15" height="15" border="0" align="absmiddle" id="color_1" /></a>Rot |