Esempio n. 1
0
    $db = new MyDB();
    if (!$db) {
        echo $db->lastErrorMsg();
    } else {
        echo "Opened database successfully</br>";
    }
    $userName = $_COOKIE["username"];
    $sql = <<<EOF
      UPDATE User set gender='{$gender}', height='{$height}', weight='{$weight}', birth='{$birth}',country='{$country}',city='{$city}',address='{$address}' where name='{$userName}';
EOF;
    $ret = $db->exec($sql);
    if (!$ret) {
        echo $db->lastErrorMsg();
    } else {
        header("Location: http://www.kmoving.com/server/user/settings.php");
    }
    $db->close();
}
$name = $_POST["name"];
$gender = $_POST["gender"];
$height = $_POST["height"];
$weight = $_POST["weight"];
$birth = $_POST["birth"];
$country = $_POST["country"];
$city = $_POST["city"];
$address = $_POST["address"];
if ($gender != null || $height != null || $height != null || $weight != null || $country != null || $city != null || $address != null) {
    set_user_settings($gender, $height, $weight, $birth, $country, $city, $address);
} else {
    get_user_settings();
}
Esempio n. 2
0
         } else {
             $query .= ",`status`=" . STAT_APPROVED;
         }
         if ($force_main) {
             $query .= ",`is_main`=1";
             $force_main = false;
         }
         if (!($res = @mysql_query($query))) {
             trigger_error(mysql_error(), E_USER_ERROR);
         }
         $photo_ids[] = mysql_insert_id();
     }
 }
 if (!empty($photo_ids)) {
     if ($photos_remaining != -1) {
         set_user_settings($_SESSION[_LICENSE_KEY_]['user']['user_id'], 'core_photo', 'max_user_photos', $photos_remaining);
     }
     if (empty($config['manual_photo_approval'])) {
         if (isset($_on_after_approve)) {
             $GLOBALS['photo_ids'] = $photo_ids;
             $GLOBALS['do_stats'] = true;
             for ($i = 0; isset($_on_after_approve[$i]); ++$i) {
                 call_user_func($_on_after_approve[$i]);
             }
         }
     }
     $topass['message']['type'] = MESSAGE_INFO;
     $topass['message']['text'] = sprintf($GLOBALS['_lang'][96], count($photo_ids));
     $qs = $qs_sep . array2qs(array('photo_ids' => $photo_ids));
     $qs_sep = '&';
     $nextpage = 'photo_settings.php';