//-*- C++ -*- /* ******************************************************************** ** ** Copyright (C) 1995-2000 Michael Oertel ** ** Copyright (C) 2000- PHPOpenChat Development Team ** ** http://www.ortelius.de/phpopenchat/ ** ** ** ** This program is free software. You can redistribute it and/or modify ** ** it under the terms of the PHPOpenChat License Version 1.0 ** ** ** ** This program is distributed in the hope that it will be useful, ** ** but WITHOUT ANY WARRANTY, without even the implied warranty of ** ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ** ** ** ** You should have received a copy of the PHPOpenChat License ** ** along with this program. ** ** ******************************************************************** */ /* * Include some default values */ include("defaults_inc.php"); /** * Check for access permissions of this page * * compare the given and the calculated checksum, * if they don't match the user has no permissions * and the script ends by printing a status header of 204 * (no content change by client browser) */ if(!check_permissions($nick,$pruef)){ //the user has no access permission for this page header("Location: /");//browser don't refresh his content exit; } /* * Open a database connection * The following include returns a database handle */ include ("connect_db_inc.php"); $db_handle=connect_db($DATABASEHOST,$DATABASEUSER,$DATABASEPASSWD); if(!$db_handle){ exit; } $nick = $_SESSION['nick']; $chatter = mysql_real_escape_string($_GET['chatter']); if($_POST['chatter']){ $chatter = mysql_real_escape_string($_POST['chatter']); } $result1 = mysql_query("select count(*) as count from chat_data where nick = '$chatter'",$db_handle); if(! mysql_result($result1,0,'count')){ die('Chatter nicht gefunden'); } if($_POST['chatter']){ $temp = mysql_result(mysql_query("select count(*) as count from chat_notiz where nick = '$nick' and chatter = '$chatter'",$db_handle),0,'count'); if($temp AND $_POST['text'] > ''){ $t = mysql_query("update chat_notiz set notiz = '".mysql_real_escape_string(strip_tags($_POST['text']))."' where nick = '$nick' and chatter = '$chatter'",$db_handle); }elseif($temp AND $_POST['text'] == ''){ $t = mysql_query("delete from chat_notiz where nick = '$nick' and chatter = '$chatter'", $db_handle); }elseif(!$temp AND $_POST['text'] > ''){ $t = mysql_query("insert into chat_notiz set chatter = '$chatter', nick = '$nick', notiz = '".mysql_real_escape_string(strip_tags($_POST['text']))."'",$db_handle); } } $result = mysql_query("select notiz, date_format(date,'%d.%m.%y %k:%i')as date from chat_notiz where Nick = '$nick' and chatter = '$chatter'",$db_handle); $array = mysql_fetch_array($result) ?>