I posted this before and only drew one response - and I know there is someone PHP savvy enough to tell me where I went wrong...
My issue is this. The below code is NOT picking up my $Title variable. The page will show the existing variable in the text box - you can type over it, and the original will echo AND stay in the database.
however - the $groups is changing correctly. Anyone see a problem? Here is the code:
<?
// ------------------------------------------------------------------------
// WWWThreads - PHP// Wired Community Software
// Rick Baker ([email protected])
// (c) Copyright 1999-2000
// ------------------------------------------------------------------------
// Require the library
require ("../main.inc.php");
// -----------------
// Get the user info
$Username = $w3t_myname;
$Password = $w3t_mypass;
$userob = new user;
$user = $userob -> authenticate("$Username","$Password","U_Username, U_Password");
$html = new html;
// -----------------------------
// Make sure they should be here
if ( ($user[U_Status] != 'Moderator') && ($user[U_Status] != 'Administrator')){
$html -> not_right ("You must be logged in, and be a valid administrator or moderator to access this.",$Cat);
}
// -----------------------------------
// Find out what groups they belong to
$Username_q = addslashes($User);
$query = "
SELECT Mem_Groups, Mem_Title
FROM ssb_members
WHERE Mem_Username = '$Username_q'
";
$sth = $dbh -> do_query($query);
list($Groups,$Title) = $dbh -> fetch_array($sth);
$dbh -> finish_sth($sth);
// -------------------------------
// Now let's get all of the groups
$query = "
SELECT Grp_Name, Grp_Id
FROM ssb_groups
";
$sth = $dbh -> do_query($query);
// --------------------------------------------------------------------
// Now we chug through the groups. If it was checked, we add them to
// the group. If it was unchecked we remove them from it.
$total = 0;
while ( list($Name,$Id) = $dbh -> fetch_array($sth)) {
$total++;
if ($HTTP_POST_VARS[$Id]) {
if (!ereg("-$Id-",$Groups)) {
$Groups .= "$Id-";
}
}
else {
$Groups = preg_replace("/-$Id-/","-",$Groups);
}
}
$dbh -> finish_sth($sth);
// -----------------------
// Format the query words
$Groups_q = addslashes($Groups);
$Title_q = addslashes($Title);
// --------------------------
// Update the User's profile
$query = "
UPDATE ssb_members
SET Mem_Groups = '$Groups_q',
Mem_Title = '$Title_q'
WHERE Mem_Username = '$Username_q'
";
$dbh -> do_query($query);
// ---------------------
// Send the confirmation
echo "$Title,$Groups";
$html -> send_header("This users membership listing has been changed.",$Cat,"<META HTTP-EQUIV="Refresh" content="5;url=$config[phpurl]/admin/login.php?Cat=$Cat">",$user[U_Username],0,0,$user);
$html -> table_header("This users membership listing has been changed.");
echo "<TABLE BORDER=0 WIDTH="$theme[tablewidth]" ALIGN="$theme[tablealign]"><TR><TD class="cleartable"><span class="onbody">";
echo "This users membership listing has been changed. You will now be returned to the main administration page.";
echo "</span></TD></TR></TABLE>";
// ----------------
// send the footer
$html -> send_footer();?>
Thanks in advance!