function add_CommentInSpring($week, $team, $userId, $content)
{
    $content = htmlspecialchars($content);
    if (!get_magic_quotes_gpc()) {
        $content = addslashes($content);
    }
    $query = "INSERT INTO commentsforspring(stat,userID,content,week,time,team,lastModify) values(0,{$userId},'{$content}',{$week},now(),{$team},now());";
    return mydb_query_without_return($query);
}
Exemple #2
0
    exit;
}
if ($form_data_type == 'image/jpeg') {
    $type = '.jpg';
}
if ($form_data_type == 'image/gif') {
    $type = '.gif';
}
if ($form_data_type == 'image/png') {
    $type = '.png';
}
$upfilePath = 'upload/';
$upfile = $upfilePath . $userID . $type;
if (is_uploaded_file($form_data)) {
    if (!move_uploaded_file($form_data, $upfile)) {
        echo '移动文件失败!';
        exit;
    }
} else {
    echo 'problem!';
    exit;
}
// 	$fp      = fopen($form_data, 'r');
// 	$content = fread($fp, filesize($form_data));
// 	$content = addslashes($content);
// 	fclose($fp);
// 	$data = addslashes(fread(fopen($form_data, "r"), filesize($form_data)));
// 	$query="UPDATE user SET photo = '$content' , photoType = '$form_data_type' WHERE id = 1 ;";
$query = "UPDATE user SET photoPath = '{$upfile}' , photoType = '{$form_data_type}' WHERE id = {$userID};";
mydb_query_without_return($query);
header("Location: sinaredirect.php?uid=" . $uid);