コード例 #1
0
function data_check($val)
{
    if (is_array($val)) {
        foreach ($val as $k => $v) {
            $val[$k] = data_check($v);
        }
    } else {
        if (!get_magic_quotes_gpc()) {
            $val = addslashes($val);
        }
        $dstr = array('/select/', '/insert/', '/update/', '/delete/', '/union/', '/into/', '/load_file/', '/outfile/');
        $val = preg_replace($dstr, '', $val);
    }
    return $val;
}
コード例 #2
0
ファイル: user.php プロジェクト: BackupTheBerlios/fakt
    <head>
      <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
    </head>
   <body>
    <div style="text-align: center;"><font size="+1">Thank you for registering to linuXfun<br>
    </font>here is your first time password:<font size="+1"><br>' . $first_time_password . '
    <br>
    </font></div>
   </body>
    </html> ';
/* To send HTML mail, you can set the Content-type header. */
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-8\r\n";
/* enter data into table */
include "../includes/data.php";
include "../configs/data.php";
$data_link = data_start($data_host, $data_user, $data_pass);
/* Checking if the nickname and email doesn't already exists in database */
if (data_check($data_db, "users", "nickname", $newuser->nickname)) {
    give_error("310");
}
if (data_check($data_db, "users", "email", $newuser->email)) {
    give_error("311");
}
/* Continue in registering user */
data_new_user($data_db, $data_link, $newuser->nickname, md5($newuser->password), $newuser->email, "ntba", $newuser->mess_net, $newuser->mess_id, $newuser->distro, "normal", md5($first_time_password), $this_date);
echo mysql_error($data_link);
data_stop($data_link);
/* and now mail it */
echo "We sent you a email to " . $_POST['reg_email'] . " with your first time password, check it";
// mail($to, $subject, $message, $headers);