Example #1
0
        if ($get != 'top' && $get != 'bottom') {
            if (strlen($get_page) > 0) {
                $get_page = $get_page . '&';
            }
            $get_page = $get_page . $get . '=' . intval(urlencode(stripslashes($_GET[$get])));
        }
    }
}
if (strlen($_GET['user_id']) > 0) {
    if (is_numeric($_GET['user_id'])) {
        $status_user_id = get_to_mysql($_GET['user_id']);
        $status_user_name = user_id_to_name($status_user_id);
    }
    if (!is_numeric($_GET['user_id']) || strlen($status_user_name) <= 0) {
        $status_user_name = get_to_mysql($_GET['user_id']);
        $status_user_id = name_to_user_id($status_user_name);
    }
    if (empty($status_user_id)) {
        redirect('error.php?msg=' . urlencode('No such user'));
    }
    $where = " (submit_status.user_id={$status_user_id}) ";
    $get_page = 'user_id=' . $status_user_id;
}
status_mysql_condition('pro_id', 'pro_id=');
status_mysql_condition('contest_id', 'contest_id=');
status_mysql_condition('result', 'result=');
status_mysql_condition('language', 'language=');
status_mysql_condition('top', 'submit_id<');
if (strlen($_GET['top']) == 0) {
    status_mysql_condition('bottom', 'submit_id>');
}
Example #2
0
//$_GET['name']收件人
require_once 'include/function.php';
if (!isset($_SESSION['user_id'])) {
    redirect("error.php?msg=" . urlencode("Please login first!"));
}
$from_user_id = $_SESSION['user_id'];
if (isset($_GET['name'])) {
    $to_user_name = $_GET['name'];
} else {
    if (isset($_POST['to'])) {
        $to_user_name = $_POST['to'];
    }
}
if (strlen($to_user_name) > 0) {
    $to_user_id = name_to_user_id(get_to_mysql($to_user_name));
}
set_ojinfo('title', 'ECUST Online Judge - SendMail');
include 'include/header.php';
if (isset($_POST['to'])) {
    $title = get_to_mysql($_POST['title']);
    $text = get_to_mysql($_POST['textarea']);
    $query = "insert into mails (to_user_id,from_user_id,mail_time,title,content,readed,reader_del,writer_del)" . " values({$to_user_id}, {$from_user_id}, now(), '{$title}', '{$text}', 0, 0, 0)";
    oj_query($query);
    echo "<center><h1>Send Mail Successfully!</h1></center>";
} else {
    ?>
<center><h1 style="color:#00f;">Write Mail</h1></center>
<form name="form1" method="post" action="mailsend.php" onsubmit="return check_mail()">
  <label><strong>To(name):</strong>
  <input name="to" type="text" id="mail_to" size="25" <?php