"); exit(); } } $nickname = $HTTP_POST_VARS['nickname']; if ($nickname == null) { $nickname = $HTTP_GET_VARS['nickname']; if ($nickname == null) { printError($scriptName, $startTime, "PutComment", "You must provide a nick name!
"); exit(); } } $password = $HTTP_POST_VARS['password']; if ($password == null) { $password = $HTTP_GET_VARS['password']; if ($password == null) { printError($scriptName, $startTime, "PutComment", "You must provide a password!
"); exit(); } } $itemId = $HTTP_POST_VARS['itemId']; if ($itemId == null) { $itemId = $HTTP_GET_VARS['itemId']; if ($itemId == null) { printError($scriptName, $startTime, "PutComment", "You must provide an item identifier!
"); exit(); } } getDatabaseLink($link); beginRO($link); // Authenticate the user $userId = authenticate($nickname, $password, $link); if ($userId == -1) { printError($scriptName, $startTime, "PutComment", "You don't have an account on RUBiS!
You have to register first.
\n"); exit(); } function putcomment($link, $to, $itemId) { $row = getItem($link, $itemId); if (!$row) { global $scriptName, $startTime; printError($scriptName, $startTime, "PutComment", "

Sorry, but this item does not exist.


"); return NULL; } $userRow = getUser($link, $to); if (!$userRow) { global $scriptName, $startTime; printError($scriptName, $startTime, "PutComment", "

Sorry, but this user does not exist.


"); return NULL; } printHTMLheader("RUBiS: Comment service"); print("

Give feedback about your experience with ".$userRow["name"]."


\n"); $out = ("
\n". "\n". "\n". "\n". "
\n". "
From\$XXXnicknameXXX\n". "
To".$userRow["nickname"]."\n". "
About item".$row["name"]."\n". "
Rating\n". "


\n". "

\n". "

\n"); return $out; } if (MICROCACHE) $page = putcomment($link, $to, $itemId); else $page = wrap(true, 'putcomment', $link, $to, $itemId); if (!$page) exit(); echo str_replace(array('$XXXuserIdXXX', '$XXXnicknameXXX'), array($userId, $nickname), $page); commit($link); sql_close($link); printHTMLfooter($scriptName, $startTime); ?>