\n"; if ($dont_run_on_batteries) { $xml = $xml."\n"; } if ($dont_run_if_user_active) { $xml = $xml."\n"; } if ($confirm_before_connecting) { $xml = $xml."\n"; } $xml = $xml."\n"; $x = time(); if ($prefsid) { $result = mysql_query("select * from prefs where id=$prefsid"); $prefs = mysql_fetch_object($result); mysql_free_result($result); if (!$prefs || $prefs->userid != $user->id) { echo "You don't own those preferences."; exit(); } $query = "update prefs set modified_time=$x, name='$prefs_name', xml_doc='$xml' where id=$prefsid"; $result = mysql_query($query); if ($result) { echo "Preferences modified!"; } else { echo "error: ".mysql_error(); } } else { $query = "insert into prefs set userid=$user->id, create_time=$x, modified_time = $x, name='$prefs_name', xml_doc='$xml'"; $result = mysql_query($query); if ($result) { echo "Preferences created!"; } else { echo "error: ".mysql_error(); } } ?>