// settings.php for BabeStar Auditon form 2004/12/09 00:28:00
$INTERNAL_ENCODE = 'EUC-JP';
$OUTPUT_ENCODE = 'EUC-JP';
$BASE_URL = "http://".$_SERVER['HTTP_HOST']."/flyingstar/ph/audition";
$SECURE_BASE_URL = "https://".$_SERVER['HTTP_HOST']."/flyingstar/ph/audition";
$THANKS_PAGE_URL = "https://".$_SERVER['HTTP_HOST']."/flyingstar/ph/audition/thanks.phtml";
$RETURN_URL = "http://".$_SERVER['HTTP_HOST']."/flyingstar/";
// メール関係
$MAIL_FROM_ADDRESS = 'web-infra-admin@ve.jvcmusic.co.jp';
$SEND_MAIL_ADDRESS = 'babestar_audition@ve.jvcmusic.co.jp';
$SEND_MAIL_SUBJECT = 'BabeStarオーディションエントリー';
$key_std_char = '16';
$key_max_char = '24';
$USER_INPUT_REQUIRE = array(user_name,user_email,user_email_confirm,user_url,agreement);
$USER_INPUT_OPTION = array(lead_track_url,comment);
$USER_INPUT_ENTRY = array_merge($user_input_require,$user_input_option);
$punct_space_class = "[([:blank:]|[:cntrl:]|[:punct:])]+";
$number_string_class = "[0-9]";
// Error表示
$errormes_color = '#C8151F';
$errormes_template = '$insert_error_mes
\n';
#$errormes_template = '$insert_error_mes
\n';
$errormes_max_show_chars ='240';
// 携帯判定用
$mobilephone_domain = "do(c|k)omo\.ne\.jp|ezweb\.ne\.jp|jp-(d|h|t|c|r|k|n|s|q)\.ne\.jp|vodafone\.ne\.jp|\.ido\.ne\.jp|email\.sky\.tdp\.ne\.jp|email\.sky\.kdp\.ne\.jp|email\.sky\.cdp\.ne\.jp|sky\.tu-ka\.ne\.jp|cara\.tu-ka\.ne\.jp|sky\.tkk\.ne\.jp|sky\.tkc\.ne\.jp|pdx\.ne\.jp|nttpnet\.ne\.jp|phone\.ne\.jp|mozio\.ne\.jp|page\.docomonet\.or\.jp|page\.ttm\.ne\.jp|pho\.ne\.jp|moco\.ne\.jp|emcm\.ne\.jp|p1\.foomoon\.com|\.i-get\.ne\.jp|softbank\.ne\.jp";
$imode_domain ='docomo\.ne\.jp';
$ezweb_domain = 'ezweb\.ne\.jp|\.ido\.ne\.jp|email\.sky\.tdp\.ne\.jp|email\.sky\.kdp\.ne\.jp|email\.sky\.cdp\.ne\.jp|sky\.tu-ka\.ne\.jp|cara\.tu-ka\.ne\.jp|sky\.tkk\.ne\.jp|sky\.tkc\.ne\.jp';
$jsky_domain = 'jp-(d|h|t|c|r|k|n|s|q)\.ne\.jp|vodafone\.ne\.jp|softbank\.ne\.jp';
?>
## ----関数定義ここから---- for SAS SEA OF LOVE user_enquete v1.00 2003/07/19 11:00:00
if(!$errormes_color)
{
$errormes_color = "#ff0000";
}
// Cache抑制Header発行
function suppressCache()
{
$gmDatetime = gmdate("D, d M Y H:i:s") . " GMT";
header("Expires: 0");
header("Last-Modified: " . $gmDatetime);
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0, post-check=0, pre-check=0");
header("Pragma: no-cache");
};
// ErrorMes登録(一応XSS対策)
function insertErrormes($insert_error_mes,$template)
{
global $error_mes;
global $errormes_color;
global $errormes_max_show_chars;
$insert_error_mes = mb_substr($insert_error_mes,0,$errormes_max_show_chars);
$insert_error_mes = htmlspecialchars($insert_error_mes);
eval("\$format_error_mes = \"$template\";");
$error_mes .= $format_error_mes;
};
// ErrorPage表示
function printErrorpage($error_mes,$template_filename)
{
global $internal_encode;
global $output_encode;
global $base_url;
ob_end_clean();
mb_http_output($output_encode);
ob_start('mb_output_handler');
suppressCache();
include_once "$template_filename";
ob_end_flush();
mb_http_output($internal_encode);
};
// 文字列クラス判定
function checkStringClass($abname,$inputValue,$stringClass,$meta_stringClass,$allow_meta_stringClass)
{
global $badInput;
global $$inputValue;
global $errormes_template;
$check_string = $$inputValue;
$check_string = ereg_replace($allow_meta_stringClass,"",$check_string);
$check_metastring = ereg($meta_stringClass,$check_string);
if($check_metastring)
{
$check_string = ereg_replace($meta_stringClass,"",$check_string);
insertErrormes("$abname にスペースか記号が入っています",$errormes_template);
$badInput= 1;
}
do
{
unset($invalid_string);
$invalid_string = ereg($stringClass,$check_string,$match_string);
if($invalid_string)
{
$replace_string = quotemeta($match_string[0]);
$indicate_match_string .= $match_string[0];
$check_string = ereg_replace($replace_string,"",$check_string);
$badString = 1;
}
}
while($invalid_string);
if($badString)
{
insertErrormes("$abname に使用出来ない文字が入っています「 $indicate_match_string 」",$errormes_template);
$badInput = 1;
}
};
// array内要素copy&rename
function array_CopyRename($Value_Name,$Array_Count,$Value_Prefix,$Array_Name)
{
if(ereg(",",$Value_Prefix))
{
$split_param = split(",",$Value_Prefix);
$Value_Prefix = $split_param[0];
$Array_Name = $split_param[1];
}
global ${$Value_Name};
global ${$Array_Name};
$new_value_name = $Value_Prefix . $Value_Name;
global $$new_value_name;
${$new_value_name} = ${$Value_Name};
array_push(${$Array_Name},${new_value_name});
};
// 半角カナ->全角カナ,全角英字->半角英字,全角空白->半角空白処理,両端空白文字処理
function convert_string($Value_Name)
{
global ${$Value_Name};
$tmp_value = ${$Value_Name};
$tmp_value = mb_convert_kana($tmp_value,"KVanrs");
${$Value_Name} = trim($tmp_value);
};
// 半角カナ->全角カナ処理,,両端空白文字処理
function convert_string_kana($Value_Name)
{
global ${$Value_Name};
$tmp_value = ${$Value_Name};
$tmp_value = mb_convert_kana($tmp_value,"KVCanrs");
${$Value_Name} = trim($tmp_value);
};
// 改行、TABコード削除
function strip_returns($Value_Name)
{
global ${$Value_Name};
$tmp_value = ${$Value_Name};
${$Value_Name} = ereg_replace("\r|\n|\t","",$tmp_value);
};
// 記入漏れ、文字数オーバーチェック
function checkQuery($abname,$inputValue,$maxLength,$mode)
{
global $badInput;
global ${$inputValue};
global $errormes_template;
$zenMaxlength = $maxLength / 2;
if($mode == "1")
{
if(${$inputValue} != "0")
{
if((${$inputValue} == FALSE) or (${$inputValue} == "dmy"))
{
insertErrormes("$abname が入力されていません",$errormes_template);
$badInput = 1;
}
}
}
if(strlen(${$inputValue}) > $maxLength)
{
insertErrormes("$abname が長すぎます、半角$maxLength(全角$zenMaxlength)文字以内で記入してください",$errormes_template);
$badInput = 1;
}
};
function minimumQuery($abname,$inputValue,$minLength,$mode)
{
global $badInput;
global ${$inputValue};
global $errormes_template;
$zen_minLength = $minLength / 2;
if(($mode == "1") and ((${$inputValue} != "dmy") and (${$inputValue})))
{
if(strlen(${$inputValue}) < $minLength)
{
insertErrormes("$abname が短すぎます、半角$minLength(全角$zen_minLength)文字以上記入してください",$errormes_template);
$badInput = 1;
}
}
};
function makeUrlEncode($inputValue)
{
global ${$inputValue};
$tmp_value = ${$inputValue};
${$inputValue} = rawurlencode($tmp_value);
};
function makeUrlDecode($inputValue)
{
global ${$inputValue};
$tmp_value = ${$inputValue};
${$inputValue} = rawurldecode($tmp_value);
};
function makeHtmlEncode($inputValue)
{
global ${$inputValue};
$tmp_value = ${$inputValue};
# $tmp_value = trim(strip_tags($tmp_value));
${$inputValue} = htmlspecialchars($tmp_value);
};
// DB追加変数作成
function makeInsertValue(&$inputValue)
{
global ${$inputValue};
$tmp_value = ${$inputValue};
if($tmp_value == "on")
{
$tmp_value = 1;
}
${$inputValue} = addslashes($tmp_value);
};
// checkbox 記入済みcheck
function fillCheckBox($CheckBoxName)
{
global ${$CheckBoxName};
global $form_body;
if(${$CheckBoxName})
{
$form_body = eregi_replace("\"$CheckBoxName\"","\"$CheckBoxName\" checked",$form_body);
}
};
// RADIOボタンcheck
function fillRadioButton($ButtonName)
{
global ${$ButtonName};
global $form_body;
$form_body = eregi_replace("\"$ButtonName\" value=\"${$ButtonName}\"","\"$ButtonName\" value=\"${$ButtonName}\" checked","$form_body");
};
// Selectメニューチェック
function fillSelectMenu($SelectName)
{
global ${$SelectName};
global $form_body;
if(${$SelectName} != "dmy")
{
$form_body = eregi_replace("option value=\"${$SelectName}\"","option value=\"${$SelectName}\" selected",$form_body);
}
};
// TextBox -> Checkbox補間
function fillTextBox($inputArray)
{
$count_values = count($inputArray);
for($i = 0; $i < $count_values; $i++)
{
$current_value = $inputArray[$i];
global ${$current_value};
if((${$current_value} != "dmy") and (${$current_value}))
{
$fillCheckBox = eregi_replace("(_name|_name[0-9])","",$current_value);
global ${$fillCheckBox};
${$fillCheckBox} = 1;
}
}
};
// checkbox 選択数制限
function limitCheckBox ($abname,$inputArray,$limit)
{
global $errormes_template;
global $badInput;
$count_values = count($inputArray);
for($i = 0; $i <= $count_values; $i++)
{
$current_value = $inputArray[$i];
global ${$current_value};
if(${$current_value})
{
$counter++;
}
}
if($counter > $limit)
{
insertErrormes("$abname の選択されている項目が多すぎます。$limit 個までにして下さい",$errormes_template);
$badInput = 1;
}
};
// チェックボックス最低数check
function minimumCheckbox($abname,$inputArray,$minimum)
{
global $errormes_template;
global $badInput;
$count_values = count($inputArray);
for($i = 0; $i <= $count_values; $i++)
{
$selected_value = $inputArray[$i];
global ${$selected_value};
if(${$selected_value})
{
$counter++;
}
}
if($counter < $minimum)
{
insertErrormes("$abname は最低 $minimum 個選択して下さい。",$errormes_template);
$badInput = 1;
}
};
// RFC821,822(メールアドレス表現)チェック
function checkValidMailAddress($EmailAddress)
{
global $badInput;
global $errormes_template;
//半角空白若しくは全角空白があった場合は取り除く
$EmailAddress = ereg_replace("(\r|\n|\t| )","",$EmailAddress);
$address_notfound = "メールアドレス が入力されていません";
$invalid_address = "$EmailAddress は有効なメールアドレスではありません";
if(!$EmailAddress)
{
insertErrormes($address_notfound,$errormes_template);
$badInput = 1;
$badAddress = 1;
}
if(mb_detect_encoding($EmailAddress) != "ASCII")
{
insertErrormes($invalid_address,$errormes_template);
$badInput = 1;
$badAddress = 1;
}
$splitMailPart = split("\@",$EmailAddress);
$UserPart = $splitMailPart[0];
$DomainPart = $splitMailPart[1];
if(((!$UserPart) or (!$DomainPart) or (count($splitMailPart) > 2)) and (!$badAddress))
{
insertErrormes($invalid_address,$errormes_template);
$badInput = 1;
$badAddress = 1;
}
if(!$badAddress)
{
if(eregi("\(|\)|\<|\>|\<|\>|\@|\,|\;|\[|\]",$UserPart))
{
insertErrormes($invalid_address,$errormes_template);
$badInput = 1;
$badAddress = 1;
}
}
if(!$badAddress)
{
if(eregi("\ー|\.\.|\!|\"|\#|\\$|\%|\&|\'|\(|\)|\=|\~|\||\^|\\@|\`|\{|\[|\}|\]|\;|\+|\:|\*|\,|\<|\>|\?|\/|\_|\\|",$DomainPart))
{
insertErrormes($invalid_address,$errormes_template);
$badInput = 1;
$badAddress = 1;
}
}
if(!$badAddress)
{
$splitDomainPart = split("\.",$DomainPart);
$num_of_parts = count($splitDomainPart);
if($num_of_parts < 2)
{
insertErrormes($invalid_address,$errormes_template);
$badInput = 1;
$badAddress = 1;
}
}
if(!$badAddress)
{
$last_parts = $splitDomainPart[$num_of_parts - 1];
$TLD_chars = strlen($last_parts);
if(($TLD_chars < 2) or ($TLD_chars >= 4))
{
insertErrormes($invalid_address,$errormes_template);
$badInput = 1;
$badAddress = 1;
}
}
if(!$badAddress)
{
$first_Char = substr($DomainPart,0,1);
$last_Char = substr($DomainPart,-1,1);
if((eregi("\-|\.","$first_Char")) or (eregi("\-",$last_Char)))
{
insertErrormes($invalid_address,$errormes_template);
$badInput = 1;
$badAddress = 1;
}
}
return $EmailAddress;
};
function checkMobilePhone($email)
{
global $mobilephone_domain;
global $imode_domain;
global $ezweb_domain;
global $jsky_domain;
$split_email = split("@",$email);
$domain_part = $split_email[1];
if(eregi($mobilephone_domain,$domain_part))
{
if(eregi($imode_domain,$domain_part))
{
$mail_domain = '1';
}
elseif(eregi($ezweb_domain,$domain_part))
{
$mail_domain = '2';
}
elseif(eregi($jsky_domain,$domain_part))
{
$mail_domain = '3';
}
else
{
$mail_domain = '4';
}
}
else
{
$mail_domain = '0';
}
return $mail_domain;
};
function checkValidDate ($abname,&$date)
{
global $badInput;
global $errormes_template;
$tmp_date = eregi_replace("[a-z]","",$date);
$split_date = split("-","$tmp_date","3");
if(($split_date[0]) and ($split_date[1]) and ($split_date[2]))
{
$validdate = checkdate($split_date[1],$split_date[2],$split_date[0]);
if(!$validdate)
{
$indicate_date = $split_date[0] . "年" . $split_date[1] . "月" . $split_date[2] . "日";
insertErrormes("$indicate_date は有効な日付ではありません",$errormes_template);
$badInput = 1;
}
else
{
$date = $tmp_date;
}
}
else
{
insertErrormes("$abname が入力されていません",$errormes_template);
$badInput = 1;
}
};
// Unique Key 生成
function genUniqueKey($con_id,$table_name,$column_name,$max_char){
do{
$key_salt = uniqid("s","true");
$unique_key = strtoupper(md5($key_salt));
$unique_key = substr($unique_key,0,$max_char);
// Insert対象となるcolumn内で重複しないかチェックする
$check_dup_key_sql = <<< EOM
select oid from $table_name where $column_name = '$unique_key'
EOM;
$check_dup_key = pg_exec($con_id,$check_dup_key_sql);
if(!pg_numrows($check_dup_key)){
$key_is_unique = 1;
}
}
while(!$key_is_unique);
return $unique_key;
unset($unique_key);
@pg_freeresult($check_dup_key);
};
//郵便番号チェック
function checkValidPostalCode ($abname,&$postal_code){
global $badInput;
global $errormes_template;
if(!(ereg("^[0-9]{7}$",$postal_code))){
insertErrormes("郵便番号は\"-\"(ハイフン)をつけず数字7桁で記入してください。",$errormes_template);
$badInput = 1;
}
};
?>