看似不是很短,但其实想捏合的地方就几块儿,下面粘贴目前的代码情况
<?php
$word = new word();
if (isset($_GET["complete"]) && $_GET["complete"] ==1){
}
$not_header_content = true;
$header = array(
'title' =>"标题"
);
if (isset($_GET["reghash"])){
$reghash = htmlspecialchars($_GET["reghash"], ENT_QUOTES);
$email = htmlspecialchars($_GET["email"], ENT_QUOTES);
$user_id = user::get_user_id_by_hash($reghash);
$user = new user($user_id);
if ($user->is_show_menu(MENU_ID_SALON)) {
header("Location: ".get_url_top().'/home/salon/user_input.php?action=activate&email='.$email.'®hash='.$reghash);
exit;
}
user::activate($email, $reghash);
$info = user::get_info_by_id($user_id);
$corp_id_info = null;
if ($info) {
$corp_id_info = bhcs_db::getCorpIDInfoWithCorpID($info->corp_id);
}
if ($corp_id_info && $corp_id_info->corp_id_type == CORP_ID_TYPE_STUDENT) {
if (ha_db::avaiable()) {
$res = ha_db::regist($info, $corp_id_info);
$i_ha_user_id = $res->ha_user_id;
} else {
$res = new stdClass;
$res->err_msg = '';
$res->warning_msg = '错误信息';
$i_ha_user_id = -1;
}
if (!$res->err_msg){
$res = bhcs_db::regist($email, $email, $corp_id_info->client_id, $corp_id_info->app_id, 1);//creator_id = 1
$i_bh_user_id = $res->student_id;
}
if (!$res->err_msg){
$info = new stdClass;
$info->ha_user_id = $i_ha_user_id;
$info->bh_user_id = $i_bh_user_id;
$info->role = CORP_ID_TYPE_STUDENT;
if ($corp_id_info->guest== 0){
$info->available = USER_AVAILABLE_REGULAR;
}
if ($user_id >= 0){
$ss = '';
$ss .= '<div class="message_area">';
$ss .= ' <h2>信息</h2>';
$ss .= ' <p>信息</p>';
$ss .= '</div>';
$ss .= '<div class="text-center mt20 mb20"><a href="login.php" class="btn btn-primary btn-lg">文字</a></div>';
} else {
$ss = "<div class=\"alert alert-danger\">错误信息1</div>";
}
} else {
$ss = '';
$ss .= '<div class="alert alert-danger">';
foreach ($res->err_msg as $s_msg){
$ss .= '<li>'.$s_msg.'</li>';
}
$ss .= '</div>';
}
}
if ($user_id >= 0) {
$ss = '';
$ss .= '<div class="message_area">';
$ss .= ' <h2>信息</h2>';
$ss .= ' <p>信息<br>信息</p>';
$ss .= '</div>';
$ss .= '<div class="text-center mt20 mb20"><a href="login.php" class="btn btn-primary btn-lg">确定</a></div>';
} else {
$ss = "<div class=\"alert alert-danger\">错误信息</div>";
}
}
?>
<?php include(get_user_header()); ?>
<section id="fh5co-container" data-section="home" class="mt-30" data-stellar-background-ratio="0.5">
<div class="container">
<div class="text-wrap">
<div class="text-inner">
<div class="page-header">
<h1>完成</h1>
</div>
<?php echo $ss; ?>
</div>
</div>
</div>
</section>
<?php include(get_user_footer());
exit;
}
?>
<?php
$email = $_POST["email"];
$password = htmlspecialchars($_POST["password"], ENT_QUOTES);
$corp_id = isset($_POST["corp_id"]) ? htmlspecialchars($_POST["corp_id"], ENT_QUOTES) : null;
$application_type = $_POST["application_type"];
$client_id = isset($_POST["client_id"]) ? $_POST["client_id"] : null;
$bErr_email_dup = False;
if (($email != "") && (user::checkemailDuplicate($email) >= 0)){
$bErr_email_dup = True;
}
if (isset($_POST["corp_id"])) {
if ($bErr_email_dup || empty($password) || empty($corp_id) || empty($email) ){
exit;
}
} else if (isset($_POST["client_id"])) {
if ($bErr_email_dup || empty($password) || empty($email) || empty($client_id) ){
exit;
}
} else {
if ($bErr_email_dup || empty($password) || empty($email) ){
exit;
}
}
$id = user::make_and_sendmail_for_activate($email, $password, $corp_id, $application_type, $client_id);
$user_id = check_auth_user();
if($user_id == -1) {
$ss = '';
$ss .= '<div class="message_area">';
$ss .= ' <h2>信息 </h2>';
$ss .= ' <p>信息<br>信息2</p>';
$ss .= '</div>';
$ss .= '<div class="domain">';
$ss .= ' 信息3<br>';
$ss .= ' 信息4';
$ss .= ' <span>' . SUPPORT_DOMAIN . '</span><br>';
$ss .= ' 信息5。<br><br>';
$ss .= ' <span><a href="mailto:' . SUPPORT_EMAIL . '"><img src="/images/email_white.png"></a></span>';
$ss .= '</div>';
//+===========================================================================+
// LOGGING-USER-ACTION
// >>>START>>>
//+===========================================================================+
$table = database::get_table_with_scheme(LOG_USER_ACTION_TABLE_NAME);
$token = isset($_SESSION['log_user_token']) ? $_SESSION['log_user_token'] : '';
$log_user_action = database::fetch_one("SELECT * FROM ${table} WHERE token_c = '${token}';");
$update = new stdClass();
$update->email = $email;
$update->page2 = date('Y-m-d H:i:s');
if ($log_user_action && isset($log_user_action->id)) {
database::update_by_id_with_pdo(LOG_USER_ACTION_TABLE_NAME, $log_user_action->id, $update);
}
unset($_SESSION['log_user_token']);
//+===========================================================================+
// <<<END<<<
//+===========================================================================+
?>
<?php include (get_user_header()); ?>
<section id="fh5co-container" data-section="home" class="mt-30" data-stellar-background-ratio="0.5">
<div class="container">
<div class="text-wrap">
<div class="text-inner">
<div class="page-header">
<h1>完成</h1>
</div>
<?php echo $ss; ?>
</div>
</div>
</div>
</section>
<?php include (get_user_footer()); ?>
<?php
} else {
header("Location: ".get_url_top());
}
?>
询问一个关于php和html的立旗输出不同信息的问题,
在这种情况下 如何利用flag=true 和 fiag=false,将所有的html只捏合到此页的下方
(} else {header("Location: ".get_url_top());}的上面
换句话说就是只保留一对include就能输出所有的在此页中的信息
感谢解答