hi every one, this is my first post.
I have a website with a voicechat. in the admin panel there is an option to change user’s details. you click on the link and takes you to a user list page where you select teh user you want and then you can edit the information for that user.
is there away to make a link on the chatroom for users to click on it and hav an option to change their own details?
the admin panel to change people’s info doesnt work properly, the company who provided me with the script won’t help me get ride of the errors, whenever i press Apply changes i get this error “You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘Activate = 1,ShowIP = 0,ShowBAN = 0,Webcam = 0 WHERE Username=‘Whatever’’ at line 1”
below is the sourcecode for the page where the admin can edit the user’s details. i really need this, please let me know if you can help me, am not good at programming.
[code]<?
ini_set(“output_buffering”, “1”);
ini_set(“register_globals”, “0”);
ini_set(“session.use_cookies”, “1”);
ini_set(“session.use_trans_sid”, “1”);
require_once “inc/iv-app.class.php”;
$app = new CBabChatApp();
if (!$app->isRoot())
{
$app->execute("./logout.php");
}
$gotError = false;
$errorMsg = “”;
$conn = new CConnection(DB_USER, DB_PASS, DB_HOST);
if ($app->getPost(“action”) === “update”)
{
if (strlen(trim($app->getPost(“email”))) == 0)
{
$gotError = true;
$errorMsg = “You Must Supply An Email Address”;
}
if ($app->getPost("changePasswd") == 1)
{
if (strlen(trim($app->getPost("passwd2"))) == 0)
{
$gotError = true;
$errorMsg = "You Must Retype Your Password";
}
if (strlen(trim($app->getPost("passwd"))) == 0)
{
$gotError = true;
$errorMsg = "You Must Supply A Password";
}
if ($app->getPost("passwd") !== $app->getPost("passwd2"))
{
$gotError = true;
$errorMsg = "Passwords Do Not Match";
}
}
if (!$gotError)
{
if ($conn->open(DB_NAME))
{
$mode = $app->getPost("Mode");
$invisible = $app->getPost("invisible");
if ($app->getPost("disguised") == 1)
{
$invisible = 2;
}
$rec = new CRecord(&$conn);
$rec->setTableName("Users");
$rec->initTableData(sprintf("Username = '%s'", $app->getQuery("user")));
$rec->setItem("Email", $app->getPost("email"));
$rec->setItem("Color", $app->getPost("color"));
if ($app->getPost("changePasswd") == 1)
{
$rec->setItem("Password", $app->myEncrypt($app->getPost("passwd")));
}
$rec->setItem("isAdmin", $app->getPost("isAdmin"));
$rec->setItem("Mode", $mode);
$rec->setItem("Invisible", $invisible);
$rec->setItem("Sex", $app->getPost("sex"));
$rec->setItem("ShowIP", $app->getPost("showip"));
$rec->setItem("Activate", $app->getPost("active"));
$rec->setItem("VoicePM", $app->getPost("voicepm"));
$rec->setItem("TextPM", $app->getPost("textpm"));
$rec->setItem("ShowBAN", $app->getPost("showban"));
$rec->setItem("Webcam", $app->getPost("webcam"));
$gotError = !$rec->update(sprintf("Username='%s'", $app->getPost("user")));
if ($gotError)
{
$errorMsg = $conn->getError();
}
$conn->close();
if (!$gotError)
{
$app->execute("./usermanager.php?page=" . $app->getQuery("page"));
}
}
}
}
if (!$app->userExists($app->getQuery(“user”)) && !$app->userExists($app->getPost(“user”)))
{
$app->execute("./usermanager.php?page=" . $app->getQuery(“page”));
}
if ($conn->open(DB_NAME))
{
$rs = new CRecordSet(&$conn);
if ($rs->query(sprintf("SELECT * FROM Users WHERE (Username = '%s')", $app->getQuery("user"))))
{
if ($rs->getNumRows() != 0)
{
$user = $rs->getAssoc();
}
$rs->free();
}
$conn->free();
}
?>
:: user editor " method="post"> ">Editing User Information For: <?= $app->getQuery("user"); ?> | ||||||||||||||||||||||||||||||||||
|
MOD EDIT: Changed quote to code tags