![]() |
What is wrong with this query?
I'm trying to custom write a user title color hack and I almost got it... However when the page loads online and I update the settings for some reason it's not making changes to the database row in the user table which is called titlecolor.
// ############################### Edit Title Color ############################### if ($_REQUEST['do'] == 'edittitlecolor') { $templatename = 'titlecolor'; } // ############################### Update Title Color ############################### if ($_POST['do'] == 'updatetitlecolor') { globalize($_POST, array('titlecolor' => STR)); // Support tags HTML grog6 $titlecolor = strip_tags($titlecolor); $DB_site->query(" UPDATE " . TABLE_PREFIX . "user SET titlecolor = '" . addslashes($titlecolor) ."' WHERE userid = $bbuserinfo[userid] "); echo "titlecolor"; $url = "usercp.php?$session[sessionurl]"; eval(print_standard_redirect('redirect_updatethank s')); } |
good question...
do you have global.php required? And do you make sure somewhere, that the user is logged in? (not that $bbuserinfo[userid] is empty) are you getting any error messages anywhere? |
add echo statements to see if it's actually getting the variable. (I notice you're missing the $ in your echo statement)
Other than that the code looks fine, so I would say it's on the html form side of the script. |
Script's going through and I just used that echo statement as an example. I edited a row on my user in phpmyadmin and like changed the "titlecolor" to silver... went online on the page it was there and it showed silver, I then changed it to white and clicked save and then it went back to being blank where $usertitle should of been. So for some reason it's not saving through the database as text *shrugs*
|
$titlecolor is probably not being set.
post the html of your form that submits to script, the problem is probably in there. |
Can you format you code with tabs to make it a little easier for us to read :)?
|
Okay here's the complete non working script. ;)
Under the template definitions at the top of profile.php I have added this... Quote:
And to finish it off I have this template... Quote:
|
All times are GMT. The time now is 10:54 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|