Skrypt posiada logowanie po zalogowaniu można dopiero pisać, ale tak naprawde logowanie nie jest mi wcale potrzebne bo mam na stronie, i teraz prosiłbym o pomoc jak przerobić skrypt aby po zalogowaniu na strone można było pisać i żeby wyświetlal nazwe użytkownika ze strony.
Wygląda to tak puki co(obrazek dużo wyjaśni):

Pozdrawiam
<?php // set error reporting level else // initialization of login system and generation code $oSimpleLoginSystem = new SimpleLoginSystem(); // draw login box // draw shoutbox application // class SimpleLoginSystem class SimpleLoginSystem { // variables var $aExistedMembers; // Existed members array // constructor function SimpleLoginSystem() { 'User1' => 'd8578edf8458ce06fbc5bb76a58c5ca4', //Sample: MD5('qwerty') 'User2' => 'd8578edf8458ce06fbc5bb76a58c5ca4' ); } function getLoginBox() { require_once('login_form.html'); $sLogoutForm = '<a href="'.$_SERVER['PHP_SELF'].'?logout=1">logout</a>'; if ((int)$_REQUEST['logout'] == 1) { $this->simple_logout(); } if ($_REQUEST['username'] && $_REQUEST['password']) { $this->simple_login($_REQUEST['username'], $_REQUEST['password']); return 'Hello ' . $_REQUEST['username'] . '! ' . $sLogoutForm; } else { return 'Username or Password is incorrect' . $sLoginForm; } } else { if ($_COOKIE['member_name'] && $_COOKIE['member_pass']) { if ($this->check_login($_COOKIE['member_name'], $_COOKIE['member_pass'])) { return 'Hello ' . $_COOKIE['member_name'] . '! ' . $sLogoutForm; } } return $sLoginForm; } } function simple_login($sName, $sPass) { $this->simple_logout(); $_COOKIE['member_name'] = $sName; $_COOKIE['member_pass'] = $sMd5Password; } function simple_logout() { } function check_login($sName, $sPass) { return ($this->aExistedMembers[$sName] == $sPass); } // shoutbox functions addon function getShoutbox() { //the host, name, and password for your mysql //select the database // adding to DB table posted message if ($_COOKIE['member_name']) { $sUsername = $_COOKIE['member_name']; mysql_query("INSERT INTO `s_messages` SET `user`='{$sUsername}', `message`='{$sMessage}', `when`=UNIX_TIMESTAMP()"); } } //returning the last 5 messages $sMessages = ''; // collecting list of messages $sMessages .= '<div class="message">' . $aMessages['user'] . ': ' . $aMessages['message'] . '<span>(' . $sWhen . ')</span></div>'; } db_close(); require_once('shoutbox_begin.html'); require_once('shoutbox_end.html'); return $sShoutboxForm; } } ?>