rjcfan4ever Posted August 24, 2011 Share Posted August 24, 2011 So if I change the user his data to banned or something he don't change Here is the part of the code: $userInfo = $db->getuserInfo($_GET['id']); if ($userInfo) { echo '<form action="'.coreLink('admin', 'users').'" method="post"><input type="hidden" name="userID" value="'.$userInfo['ID'].'"><ul class="inputs"> <li> <div style="float:right"><input type="text" name="username" class="input" value="'.$userInfo['username'].'"></div> '.__('Username').'<br /><small>'.__('Nickname of the user').'</small> </li> <li> <div style="float:right"><input type="text" name="pass" class="input" value=""></div> '.__('Change password').'<br /><small>'.__("Fill this input if you want to change it's password").'</small> </li> <li> <div style="float:right"><input type="text" name="email" class="input" value="'.$userInfo['email'].'"></div> '.__('Email').'<br /><small>'.__('Email of the user').'</small> </li> <li> <div style="float:right"><input type="text" name="api" class="input" value="'.$userInfo['api'].'"></div> '.__('API Code').'<br /><small>'.__('Used to access through the API').'</small> </li> <li> <div style="float:right"><select class="input" name="status" style="width:311px">'; foreach (array('ok'=>__('Active'), 'nc'=>__('Not confirmed'), 'banned'=>__('Banned')) as $key=>$long) { echo '<option value="'.$key.'"'; if ($key == $userInfo['status']) echo ' selected'; echo '>'.$long.'</option>'; } echo '</select> </div> '.__('Status').'<br /><small>'.__('It can be active, banned..').'</small> </li> <li> <fieldset id="shorters" style="border: 1px solid #ddd;-moz-border-radius:2px;-webkit-border-radius:2px"><legend>'.__('Profile').'</legend><br /><div style="padding-left:40px;margin-bottom:20px;width:110px">'; $avatar = getAvatar($userInfo['ID'], '48'); if (!$userInfo['gravatar'] && ($avatar != $jk->base."static/img/avatar/default_note.png")) echo '<div style="float:right;font-size:.8em"><input type="checkbox" name="avatar"> <img src="'.$jk->base.'static/img/trash.gif"></div>'; echo '<img src="'.getAvatar($userInfo['ID'], '48').'" style="border: 1px solid #ddd"></div> <ul> <li> <div style="float:right"><input type="text" name="profile_name" class="input" value="'.$userInfo['realname'].'"></div> '.__('Name').'<br /><small>'.__('Real name of the user').'</small> </li> <li> <div style="float:right"><input type="text" name="profile_web" class="input" value="'.$userInfo['profile']['url'].'"></div> '.__('Website').'<br /><small>'.__('Website of the user').'</small> </li> <li> <div style="float:right"><input type="text" name="profile_location" class="input" value="'.$userInfo['location'].'"></div> '.__('Location').'<br /><small>'.__('Location of the user').'</small> </li> <li> <div style="float:right"><input type="text" name="profile_bio" class="input" value="'.$userInfo['profile']['bio'].'"></div> '.__('Bio').'<br /><small>'.__('Description of the user').'</small> </li> </ul></fieldset> </li> <li> <div style="float:right"><select class="input" name="language" style="width:311px">'; foreach (return_languages() as $short=>$lang) { echo '<option value="'.$short.'"'; if ($short == $userInfo['language']) echo ' selected'; echo '>'.$lang.'</option>'; } echo '</select> </div> '.__('Language').'<br /><small>'.__('Language of the user').'</small> </li> <li> <div style="float:right"><select class="input" name="theme" style="width:311px">'; foreach ($jk->allowed_themes as $theme) { echo '<option value="'.$theme.'"'; if ($theme == $userInfo['theme']) echo ' selected'; echo '>'.$theme.'</option>'; } echo '</select> </div> '.__('Theme').'<br /><small>'.__('Skin of Jisko').'</small> </li> <li> <div style="float:right"><input type="text" name="invitations" class="input" value="'.$userInfo['invitations'].'"></div> '.__('Number of invitations').'<br /><small>'.__('Number of invitations that the user has').'</small> </li> <li> <div style="float:right"><input type="text" name="openid" class="input" value="'.$userInfo['openid'].'"></div> '.__('OpenID').'<br /><small>'.__('Used to access Jisko trough an OpenID account').'</small> </li> <li> <div style="float:right"><input type="text" name="facebook" class="input" value="'.$userInfo['facebook'].'"></div> '.__('Facebook ID').'<br /><small>'.__('Used to access Jisko trough a Facebook account').'</small> </li> </ul> <br /><input type="submit" value="'.__('Save').'"><br /><br /></form>'; } else header('Location: '.coreLink('admin', 'users')); } Quote Link to comment https://forums.phpfreaks.com/topic/245577-admin-pannel-user-data-dont-save/ Share on other sites More sharing options...
trq Posted August 24, 2011 Share Posted August 24, 2011 Well said. Quote Link to comment https://forums.phpfreaks.com/topic/245577-admin-pannel-user-data-dont-save/#findComment-1261318 Share on other sites More sharing options...
rjcfan4ever Posted August 24, 2011 Author Share Posted August 24, 2011 Thanks Quote Link to comment https://forums.phpfreaks.com/topic/245577-admin-pannel-user-data-dont-save/#findComment-1261340 Share on other sites More sharing options...
MasterACE14 Posted August 24, 2011 Share Posted August 24, 2011 there's nothing in this code to update the user data in your (I'm assuming) database. Need to post your code for the file that this form is sent to. Quote Link to comment https://forums.phpfreaks.com/topic/245577-admin-pannel-user-data-dont-save/#findComment-1261347 Share on other sites More sharing options...
rjcfan4ever Posted August 24, 2011 Author Share Posted August 24, 2011 CREATE TABLE IF NOT EXISTS `users` ( `ID` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(22) NOT NULL, `password` varchar(40) NOT NULL, `api` varchar(16) NOT NULL, `salt` char(5) NOT NULL, `avatar` varchar(32) DEFAULT NULL, `language` varchar(5) DEFAULT NULL, `theme` varchar(255) NOT NULL, `realname` varchar(64) DEFAULT NULL, `email` varchar(64) NOT NULL, `jabber` varchar(64) DEFAULT NULL, `location` varchar(64) DEFAULT NULL, `invitations` int(11) DEFAULT NULL, `status` enum('ok','nc','banned') NOT NULL DEFAULT 'ok', `since` int(10) NOT NULL, `last_seen` int(10) NOT NULL, `last_follow` int(10) NOT NULL, `ip` varchar(16) NOT NULL, `jabber_notifications` int(1) NOT NULL DEFAULT '1', `notification_level` int(1) NOT NULL DEFAULT '2', `ignored` text, `last_note` int(10) NOT NULL, `shorter_service` varchar(255) NOT NULL DEFAULT 'a:3:{s:7:"service";s:7:"default";s:4:"data";s:0:"";s:7:"preview";b:0;}', `gravatar` int(1) NOT NULL DEFAULT '0', `openid` varchar(255) DEFAULT NULL, `facebook` varchar(255) DEFAULT NULL, `twitter` text, `extras` text, `profile` text, `customize` text, `privacy` text, PRIMARY KEY (`ID`), UNIQUE KEY `username` (`username`), UNIQUE KEY `openid` (`openid`), UNIQUE KEY `facebook` (`facebook`), KEY `api` (`api`), KEY `email` (`email`), KEY `since` (`since`), KEY `jabber` (`jabber`), KEY `last_change` (`last_follow`), KEY `last_note` (`last_note`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; Quote Link to comment https://forums.phpfreaks.com/topic/245577-admin-pannel-user-data-dont-save/#findComment-1261383 Share on other sites More sharing options...
cunoodle2 Posted August 24, 2011 Share Posted August 24, 2011 Well said. I would just follow this advice from thorpe as it seems that even in your last post with the "create table" statement you seem to have a nice job of simply posting some random code. Oh, in the future please use the "code" blocks. Quote Link to comment https://forums.phpfreaks.com/topic/245577-admin-pannel-user-data-dont-save/#findComment-1261386 Share on other sites More sharing options...
MasterACE14 Posted August 25, 2011 Share Posted August 25, 2011 Not your SQL dump. The PHP code that is in whatever page this returns... coreLink('admin', 'users') within the action='' attribute. Quote Link to comment https://forums.phpfreaks.com/topic/245577-admin-pannel-user-data-dont-save/#findComment-1261719 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.