本文整理汇总了PHP中display_setup_form函数的典型用法代码示例。如果您正苦于以下问题:PHP display_setup_form函数的具体用法?PHP display_setup_form怎么用?PHP display_setup_form使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了display_setup_form函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elseif
$error = true;
} elseif ($user_name != sanitize_user($user_name, true)) {
display_setup_form(__('the username you provided has invalid characters.'));
$error = true;
} elseif ($admin_password != $admin_password_check) {
// TODO: poka-yoke
display_setup_form(__('your passwords do not match. Please try again'));
$error = true;
} else {
if (empty($admin_email)) {
// TODO: poka-yoke
display_setup_form(__('you must provide an e-mail address.'));
$error = true;
} elseif (!is_email($admin_email)) {
// TODO: poka-yoke
display_setup_form(__('that isn’t a valid e-mail address. E-mail addresses look like: <code>username@example.com</code>'));
$error = true;
}
}
if ($error === false) {
$wpdb->show_errors();
$result = wp_install($weblog_title, $user_name, $admin_email, $public, '', $admin_password);
extract($result, EXTR_SKIP);
?>
<h1><?php
_e('Success!');
?>
</h1>
<p><?php
示例2: elseif
$error = true;
} elseif ($user_name != sanitize_user($user_name, true)) {
display_setup_form(__('The username you provided has invalid characters.'));
$error = true;
} elseif ($admin_password != $admin_password_check) {
// TODO: poka-yoke
display_setup_form(__('Your passwords do not match. Please try again.'));
$error = true;
} else {
if (empty($admin_email)) {
// TODO: poka-yoke
display_setup_form(__('You must provide an email address.'));
$error = true;
} elseif (!is_email($admin_email)) {
// TODO: poka-yoke
display_setup_form(__('Sorry, that isn’t a valid email address. Email addresses look like <code>username@example.com</code>.'));
$error = true;
}
}
if ($error === false) {
$wpdb->show_errors();
$result = wp_install($weblog_title, $user_name, $admin_email, $public, '', wp_slash($admin_password), $loaded_language);
?>
<h1><?php
_e('Success!');
?>
</h1>
<p><?php
_e('WordPress has been installed. Were you expecting more steps? Sorry to disappoint.');
示例3: json_encode
$config_str .= 'define("ENCRYPT_ENABLE", ' . ($encrypt_enable ? "true" : "false") . ');//是否加密“xss记录,封禁ip列表,js描述”' . PHP_EOL;
$config_str .= 'define("ENCRYPT_PASS", ' . json_encode($encrypt_pass) . ');//加密密码' . PHP_EOL;
$config_str .= 'define("ENCRYPT_TYPE", ' . json_encode($encrypt_type) . ');//加密方法(AES或RC4)' . PHP_EOL;
$config_str .= 'define("KEEP_SESSION", ' . ($keep_session_enable ? "true" : "false") . ');//是否启用KEEP_SESSION功能,需要外部定时访问keepsession.php' . PHP_EOL;
$config_str .= 'define("IPDATA_PATH", ' . json_encode($ipdata_path) . ');//ip归属地数据库地址' . PHP_EOL;
$config_str .= 'define("MAIL_ENABLE", ' . ($mail_enable ? "true" : "false") . ');//开启邮件通知' . PHP_EOL;
$config_str .= 'define("SMTP_SERVER", ' . json_encode($smtp_server) . ');//smtp服务器' . PHP_EOL;
//正则判断过,不做json_encode处理
$config_str .= 'define("SMTP_PORT", ' . $smtp_port . ');//端口' . PHP_EOL;
$config_str .= 'define("SMTP_SECURE", ' . json_encode($smtp_secure) . ');' . PHP_EOL;
$config_str .= 'define("MAIL_USER", ' . json_encode($mail_user) . ');//发件人用户名' . PHP_EOL;
$config_str .= 'define("MAIL_PASS", ' . json_encode($mail_pass) . ');//发件人密码' . PHP_EOL;
$config_str .= 'define("MAIL_FROM", ' . json_encode($mail_from) . ');//发件人地址(需真实,不可伪造)' . PHP_EOL;
$config_str .= 'define("MAIL_RECV", ' . json_encode($mail_recv) . ');//接收通知的邮件地址' . PHP_EOL;
if (file_put_contents("config.php", $config_str) === false) {
display_setup_form('无法写入配置文件,请确保根目录有写权限');
$error = true;
}
}
}
}
}
}
}
}
}
}
}
}
}
}