'loginname', 'email' => 'email', 'manuid' => 'manuid', 'coname' => 'coname', 'linkman' => 'linkman', 'tel' => 'tel', 'fax' => 'fax', 'address' => 'address', 'zip' => 'zip');
while( list($var, $param) = @each($strip_var_list) )
{
if ( !empty($HTTP_POST_VARS[$param]) )
{
$$var = trim(htmlspecialchars($HTTP_POST_VARS[$param]));
}
}
$trim_var_list = array('loginpwd' => 'loginpwd', 'confirmPassword' => 'confirmPassword', 'is_member' => 'is_member', 'province' => 'province', 'city' => 'city');
while( list($var, $param) = @each($trim_var_list) )
{
if ( !empty($HTTP_POST_VARS[$param]) )
{
$$var = trim($HTTP_POST_VARS[$param]);
}
}
if ( $loginname == $coname)
{
$error = true;
$error_msg = ( ( isset($error_msg) ) ? '
' : '' ) . "对不起,你的会员名已经被使用!";
}
if( empty($loginname) || empty($loginpwd) || empty($coname) || empty($email) || empty($linkman) || empty($tel) || empty($fax) || empty($address) || empty($zip) )
{
$error = true;
$error_msg = ( ( isset($error_msg) ) ? '
' : '' ) . "请认真填写表单中的每一项!";
}
if ( $loginpwd != $confirmPassword )
{
$error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? '
' : '' ) . '您提供的密码不匹配!';
}else{
$loginpwd = md5($loginpwd);
}
if(!preg_match('/^[a-z0-9\.\-_\+]+@[a-z0-9\-_]+\.([a-z0-9\-_]+\.)*?[a-z]+$/is', $email))
{
$error = true;
$error_msg = ( ( isset($error_msg) ) ? '
' : '' ) . '你提供的email不正确!';
}
if($is_member)
{
if(empty($manuid))
{
$error = true;
$error_msg = ( ( isset($error_msg) ) ? '
' : '' ) . '如果贵公司是调研公司会员,请填写会员ID号!';
}
else if(is_int($manuid))
{
$error = true;
$error_msg = ( ( isset($error_msg) ) ? '
' : '' ) . '公司ID号只能是数字!';
}
}
else
{
$manuid = 0;
}
$sql = "SELECT co_id FROM cojob_coinfo WHERE co_manuid != 0 AND co_manuid = $manuid OR co_name = '".$coname."'";
if ( !($result = $db->query($sql)) )
{
message_error(GENERAL_ERROR, 'Could not obtain data from coinfo table', '', __LINE__, __FILE__, $sql);
}
if($db->num_rows($result) > 0)
{
$error = true;
$error_msg = ( ( isset($error_msg) ) ? '
' : '' ) . '公司已经存在!';
}
$sql = "SELECT co_id FROM cojob_coinfo WHERE loginname = '".str_replace("\'", "''", $loginname)."'";
if ( !($result = $db->query($sql)) )
{
message_error(GENERAL_ERROR, 'Could not obtain data from coinfo table', '', __LINE__, __FILE__, $sql);
}
if($db->num_rows($result) > 0)
{
$error = true;
$error_msg = ( ( isset($error_msg) ) ? '
' : '' ) . '用户名已被使用,请换其他再试!';
}
if(!$error)
{
$addr = $province.'-'.$city;
$sql = "INSERT INTO cojob_coinfo (co_manuid, loginname, loginpwd, co_name, co_email, co_linkman, co_linktel, co_linkfax, co_addr, co_address, co_zip) VALUES ('" . str_replace("\'", "''", $manuid) . "', '" . str_replace("\'", "''", $loginname) . "' ,'" . $loginpwd . "', '" . str_replace("\'", "''", $coname) . "', '" . str_replace("\'", "''", $email) . "', '" . str_replace("\'", "''", $linkman) . "', '" . str_replace("\'", "''", $tel) . "', '" . str_replace("\'", "''", $fax) . "', '" . $addr . "', '" . str_replace("\'", "''", $address) . "', '" . str_replace("\'", "''", $zip) . "')";
if ( !($result = $db->query($sql, BEGIN_TRANSACTION)) )
{
message_error(GENERAL_ERROR, 'Could not insert data into coinfo table', '', __LINE__, __FILE__, $sql);
}
else
{
//////////////////// 给网站管理 ////////////////////////////
$sender_email = "service@3see.com"; //发件方邮件
$recipient = "sj@3see.com,zhy@3see.com,songmeng@3see.com"; //收件方邮件
$subject = "企业在线注册招聘系统!";
$msg = "
你好,又有新的企业注册了招聘系统,请到这里核实信息并进行激活操作
"; $msg .= "以下是企业注册信息:
|