本文整理汇总了PHP中pHeader函数的典型用法代码示例。如果您正苦于以下问题:PHP pHeader函数的具体用法?PHP pHeader怎么用?PHP pHeader使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pHeader函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: session_start
if ($conffile == "/etc/dolibarr/conf.php") {
$forcedfile = "/etc/dolibarr/install.forced.php";
}
// Must be after inc.php
if (@file_exists($forcedfile)) {
$useforcedwizard = true;
include_once $forcedfile;
}
//$force_install_message='This is the message';
//$force_install_noedit=1;
/*
* View
*/
session_start();
// To be able to keep info into session (used for not loosing pass during navigation. pass must not transit throug parmaeters)
pHeader($langs->trans("ConfigurationFile"), "step1", "set", "", empty($force_dolibarr_js_JQUERY) ? '' : $force_dolibarr_js_JQUERY . '/');
// Test if we can run a first install process
if (!is_writable($conffile)) {
print $langs->trans("ConfFileIsNotWritable", $conffiletoshow);
dolibarr_install_syslog("fileconf: config file is not writable", LOG_WARNING);
dolibarr_install_syslog("--- fileconf: end");
pFooter(1, $setuplang, 'jscheckparam');
exit;
}
if (!empty($force_install_message)) {
print '<div><table><tr><td valign="middle"><img src="../theme/common/information.png" style="height:40px;"></td><td valign="middle">' . $langs->trans($force_install_message) . '</td></tr></table>';
/*print '<script type="text/javascript">';
print ' jQuery(document).ready(function() {
jQuery("#linktoshowtechnicalparam").click(function() {
jQuery(".hidewhenedit").hide();
jQuery(".hidewhennoedit").show();
示例2: dolibarr_install_syslog
$langs->load("install");
// Now we load forced value from install.forced.php file.
$useforcedwizard = false;
$forcedfile = "./install.forced.php";
if ($conffile == "/etc/dolibarr/conf.php") {
$forcedfile = "/etc/dolibarr/install.forced.php";
}
if (@file_exists($forcedfile)) {
$useforcedwizard = true;
include_once $forcedfile;
}
dolibarr_install_syslog("--- check: Dolibarr install/upgrade process started");
/*
* View
*/
pHeader('', '');
// No next step for navigation buttons. Next step is defined by clik on links.
//print "<br>\n";
//print $langs->trans("InstallEasy")."<br><br>\n";
print '<h3>' . $langs->trans("MiscellaneousChecks") . ":</h3>\n";
// Check browser
$useragent = $_SERVER['HTTP_USER_AGENT'];
if (!empty($useragent)) {
$tmp = getBrowserInfo($_SERVER["HTTP_USER_AGENT"]);
$browserversion = $tmp['browserversion'];
$browsername = $tmp['browsername'];
if ($browsername == 'ie' && $browserversion < 7) {
print '<img src="../theme/eldy/img/warning.png" alt="Error"> ' . $langs->trans("WarningBrowserTooOld") . "<br>\n";
}
}
// Check PHP version
示例3: dolibarr_install_syslog
$choix = 1;
}
if ($dolibarr_main_db_type == "pgsql") {
$choix = 2;
}
if ($dolibarr_main_db_type == "mssql") {
$choix = 3;
}
dolibarr_install_syslog("upgrade: Entering upgrade.php page");
if (!is_object($conf)) {
dolibarr_install_syslog("upgrade2: conf file not initialized", LOG_ERR);
}
/*
* View
*/
pHeader('', "upgrade2", GETPOST('action'), 'versionfrom=' . $versionfrom . '&versionto=' . $versionto);
$actiondone = 0;
// Action to launch the migrate script
if (!GETPOST("action") || preg_match('/upgrade/i', GETPOST('action'))) {
$actiondone = 1;
print '<h3>' . $langs->trans("DatabaseMigration") . '</h3>';
if (!$versionfrom && !$versionto) {
print '<div class="error">Parameter versionfrom or versionto missing. Upgrade is launched from page install/index.php (like a first install) instead of install/upgrade.php</div>';
exit;
}
print '<table cellspacing="0" cellpadding="1" border="0" width="100%">';
$error = 0;
// If password is encoded, we decode it
if (preg_match('/crypted:/i', $dolibarr_main_db_pass) || !empty($dolibarr_main_db_encrypted_pass)) {
require_once $dolibarr_main_document_root . '/core/lib/security.lib.php';
if (preg_match('/crypted:/i', $dolibarr_main_db_pass)) {
示例4: dolibarr_install_syslog
$useforcedwizard = false;
$forcedfile = "./install.forced.php";
if ($conffile == "/etc/dolibarr/conf.php") {
$forcedfile = "/etc/dolibarr/install.forced.php";
}
if (@file_exists($forcedfile)) {
$useforcedwizard = true;
include_once $forcedfile;
}
dolibarr_install_syslog("--- step4: entering step4.php page");
$err = 0;
$ok = 0;
/*
* View
*/
pHeader($langs->trans("AdminAccountCreation"), "step5");
// Test if we can run a first install process
if (!is_writable($conffile)) {
print $langs->trans("ConfFileIsNotWritable", $conffiletoshow);
pFooter(1, $setuplang, 'jscheckparam');
exit;
}
print '<br>' . $langs->trans("LastStepDesc") . '<br><br>';
print '<table cellspacing="0" cellpadding="2" width="100%">';
$db = getDoliDBInstance($conf->db->type, $conf->db->host, $conf->db->user, $conf->db->pass, $conf->db->name, $conf->db->port);
if ($db->ok) {
print '<tr><td>' . $langs->trans("DolibarrAdminLogin") . ' :</td><td>';
print '<input name="login" type="text" value="' . (!empty($_GET["login"]) ? $_GET["login"] : (isset($force_install_dolibarrlogin) ? $force_install_dolibarrlogin : '')) . '"></td></tr>';
print '<tr><td>' . $langs->trans("Password") . ' :</td><td>';
print '<input type="password" name="pass"></td></tr>';
print '<tr><td>' . $langs->trans("PasswordAgain") . ' :</td><td>';
示例5: dolibarr_install_syslog
$langs->load("install");
// Now we load forced value from install.forced.php file.
$useforcedwizard=false;
$forcedfile="./install.forced.php";
if ($conffile == "/etc/dolibarr/conf.php") $forcedfile="/etc/dolibarr/install.forced.php";
if (@file_exists($forcedfile)) { $useforcedwizard=true; include_once $forcedfile; }
dolibarr_install_syslog("--- check: Dolibarr install/upgrade process started");
/*
* View
*/
pHeader('',''); // No next step for navigation buttons. Next step is defined by clik on links.
//print "<br>\n";
//print $langs->trans("InstallEasy")."<br><br>\n";
print '<h3>'.$langs->trans("MiscellaneousChecks").":</h3>\n";
// Check browser
$useragent=$_SERVER['HTTP_USER_AGENT'];
if (! empty($useragent))
{
$tmp=getBrowserInfo($_SERVER["HTTP_USER_AGENT"]);
$browserversion=$tmp['browserversion'];
$browsername=$tmp['browsername'];
if ($browsername == 'ie' && $browserversion < 7) print '<img src="../theme/eldy/img/warning.png" alt="Error"> '.$langs->trans("WarningBrowserTooOld")."<br>\n";
示例6: include_once
// and no database access to do.
include_once("./inc.php");
$uri=preg_replace('/^http(s?):\/\//i','',$dolibarr_main_url_root);
$pos = strstr ($uri, '/'); // $pos contient alors url sans nom domaine
if ($pos == '/') $pos = ''; // si $pos vaut /, on le met a ''
define('DOL_URL_ROOT', $pos); // URL racine relative
$langs->load("other");
$langs->load("help");
/*
* View
*/
pHeader($langs->trans("DolibarrHelpCenter"),$_SERVER["PHP_SELF"]);
print $langs->trans("HelpCenterDesc1")."<br>\n";
print $langs->trans("HelpCenterDesc2")."<br>\n";
print '<br>';
print $langs->trans("ToGoBackToDolibarr",DOL_URL_ROOT.'/');
//print '<img src="dolibarr_logo2.png" height="22" alt="Dolibarr" title="Dolibarr">';
print '<br><br>';
$style1='color: #333344; font-size: 16px; font-weight: bold';
$style2='color: #5D4455; font-weight: bold;';
print "\n";
示例7: dolibarr_install_syslog
if ($dolibarr_main_db_type == "mysql") $choix=1;
if ($dolibarr_main_db_type == "mysqli") $choix=1;
if ($dolibarr_main_db_type == "pgsql") $choix=2;
if ($dolibarr_main_db_type == "mssql") $choix=3;
dolibarr_install_syslog("upgrade: Entering upgrade.php page");
if (! is_object($conf)) dolibarr_install_syslog("upgrade2: conf file not initialized",LOG_ERR);
/*
* View
*/
pHeader('',"upgrade2",isset($_REQUEST['action'])?$_REQUEST['action']:'','versionfrom='.$versionfrom.'&versionto='.$versionto);
$actiondone=0;
// Action to launch the repair or migrate script
if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action')))
{
$actiondone=1;
print '<h3>'.$langs->trans("DatabaseMigration").'</h3>';
if (! $versionfrom && ! $versionto)
{
print '<div class="error">Parameter versionfrom or version to missing. Upgrade is launched from page install/index.php (like a first install) instead of install/upgrade.php</div>';
exit;
}
示例8: header
header("Location: etape4.php?error=1&selectlang={$setuplang}" . (isset($_POST["login"]) ? '&login=' . $_POST["login"] : ''));
exit;
}
if (dol_strlen(trim($_POST["pass"])) == 0) {
header("Location: etape4.php?error=2&selectlang={$setuplang}" . (isset($_POST["login"]) ? '&login=' . $_POST["login"] : ''));
exit;
}
if (dol_strlen(trim($_POST["login"])) == 0) {
header("Location: etape4.php?error=3&selectlang={$setuplang}" . (isset($_POST["login"]) ? '&login=' . $_POST["login"] : ''));
exit;
}
}
/*
* View
*/
pHeader($langs->trans("SetupEnd"), "etape5");
print '<br>';
// Test if we can run a first install process
if (empty($versionfrom) && empty($versionto) && !is_writable($conffile)) {
print $langs->trans("ConfFileIsNotWritable", $conffiletoshow);
pFooter(1, $setuplang, 'jscheckparam');
exit;
}
if ($action == "set" || empty($action) || preg_match('/upgrade/i', $action)) {
print '<table cellspacing="0" cellpadding="2" width="100%">';
$error = 0;
// If password is encoded, we decode it
if (preg_match('/crypted:/i', $dolibarr_main_db_pass) || !empty($dolibarr_main_db_encrypted_pass)) {
require_once $dolibarr_main_document_root . '/core/lib/security.lib.php';
if (preg_match('/crypted:/i', $dolibarr_main_db_pass)) {
$dolibarr_main_db_pass = preg_replace('/crypted:/i', '', $dolibarr_main_db_pass);
示例9: dolibarr_install_syslog
$forcedfile = "./install.forced.php";
if ($conffile == "/etc/dolibarr/conf.php")
$forcedfile = "/etc/dolibarr/install.forced.php";
if (@file_exists($forcedfile)) {
$useforcedwizard = true;
include_once($forcedfile);
}
dolibarr_install_syslog("--- etape2: Entering etape2.php page");
/*
* View
*/
pHeader($langs->trans("CreateDatabaseObjects"), "etape5");
// Test if we can run a first install process
if (!is_writable($conffile)) {
print $langs->trans("ConfFileIsNotWritable", $conffiletoshow);
pFooter(1, $setuplang, 'jscheckparam');
exit;
}
if ($action == "set") {
print '<h3>' . $langs->trans("Database") . '</h3>';
print '<table cellspacing="0" style="padding: 4px 4px 4px 0px" border="0" width="100%">';
$error = 0;
$db = getDoliDBInstance($conf->db->type, $conf->db->host, $conf->db->user, $conf->db->pass, $conf->db->name, $conf->db->port);
示例10: php_sapi_name
/*
* View
*/
if (!$versionfrom && !$versionto) {
print 'Error: Parameter versionfrom or versionto missing.' . "\n";
print 'Upgrade must be ran from cmmand line with parameters or called from page install/index.php (like a first install) instead of page install/upgrade.php' . "\n";
// Test if batch mode
$sapi_type = php_sapi_name();
$script_file = basename(__FILE__);
$path = dirname(__FILE__) . '/';
if (substr($sapi_type, 0, 3) == 'cli') {
print 'Syntax from command line: ' . $script_file . " x.y.z a.b.c\n";
}
exit;
}
pHeader('', 'etape5', GETPOST("action") ? GETPOST("action") : 'upgrade', 'versionfrom=' . $versionfrom . '&versionto=' . $versionto);
if (!GETPOST("action") || preg_match('/upgrade/i', GETPOST('action'))) {
print '<h3>' . $langs->trans('DataMigration') . '</h3>';
print '<table cellspacing="0" cellpadding="1" border="0" width="100%">';
// If password is encoded, we decode it
if (preg_match('/crypted:/i', $dolibarr_main_db_pass) || !empty($dolibarr_main_db_encrypted_pass)) {
require_once $dolibarr_main_document_root . '/core/lib/security.lib.php';
if (preg_match('/crypted:/i', $dolibarr_main_db_pass)) {
$dolibarr_main_db_pass = preg_replace('/crypted:/i', '', $dolibarr_main_db_pass);
$dolibarr_main_db_pass = dol_decode($dolibarr_main_db_pass);
$dolibarr_main_db_encrypted_pass = $dolibarr_main_db_pass;
// We need to set this as it is used to know the password was initially crypted
} else {
$dolibarr_main_db_pass = dol_decode($dolibarr_main_db_encrypted_pass);
}
}
示例11: dolibarr_install_syslog
//if (empty($choix)) dol_print_error('','Database type '.$dolibarr_main_db_type.' not supported into step2.php page');
// Now we load forced value from install.forced.php file.
$useforcedwizard = false;
$forcedfile = "./install.forced.php";
if ($conffile == "/etc/dolibarr/conf.php") {
$forcedfile = "/etc/dolibarr/install.forced.php";
}
if (@file_exists($forcedfile)) {
$useforcedwizard = true;
include_once $forcedfile;
}
dolibarr_install_syslog("--- step2: entering step2.php page");
/*
* View
*/
pHeader($langs->trans("CreateDatabaseObjects"), "step4");
// Test if we can run a first install process
if (!is_writable($conffile)) {
print $langs->trans("ConfFileIsNotWritable", $conffiletoshow);
pFooter(1, $setuplang, 'jscheckparam');
exit;
}
if ($action == "set") {
print '<h3>' . $langs->trans("Database") . '</h3>';
print '<table cellspacing="0" style="padding: 4px 4px 4px 0px" border="0" width="100%">';
$error = 0;
$db = getDoliDBInstance($conf->db->type, $conf->db->host, $conf->db->user, $conf->db->pass, $conf->db->name, $conf->db->port);
if ($db->connected) {
print "<tr><td>";
print $langs->trans("ServerConnection") . " : " . $conf->db->host . '</td><td><img src="../theme/eldy/img/tick.png" alt="Ok"></td></tr>';
$ok = 1;
示例12: header
include_once '../core/class/html.form.class.php';
include_once '../core/class/html.formadmin.class.php';
$err = 0;
// Si fichier conf existe deja et rempli, on est pas sur une premiere install,
// on ne passe donc pas par la page de choix de langue
if (file_exists($conffile) && isset($dolibarr_main_url_root)) {
header("Location: check.php?testget=ok");
exit;
}
$langs->load("admin");
/*
* View
*/
$formadmin = new FormAdmin('');
// Note: $db does not exist yet but we don't need it, so we put ''.
pHeader("", "check");
// Etape suivante = check
// Ask installation language
print '<br><br><center>';
print '<table>';
print '<tr>';
print '<td>' . $langs->trans("DefaultLanguage") . ' : </td><td align="left">';
print $formadmin->select_language('auto', 'selectlang', 1, 0, 0, 1);
print '</td>';
print '</tr>';
print '</table></center>';
print '<br><br>' . $langs->trans("SomeTranslationAreUncomplete");
// Si pas d'erreur, on affiche le bouton pour passer a l'etape suivante
if ($err == 0) {
pFooter(0);
}
示例13: header
if (file_exists($conffile) && isset($dolibarr_main_url_root))
{
header("Location: check.php?testget=ok");
exit;
}
$langs->load("admin");
/*
* View
*/
$formadmin=new FormAdmin(''); // Note: $db does not exist yet but we don't need it, so we put ''.
pHeader("", "check"); // Etape suivante = index2
print '<center>';
print '<img src="../theme/dolibarr_logo.png" alt="Dolibarr logo"><br>';
print DOL_VERSION.'<br><br>';
print '</center>';
// Ask installation language
print '<br><br><center>';
print '<table>';
print '<tr>';
print '<td>'.$langs->trans("DefaultLanguage").' : </td><td align="left">';
print $formadmin->select_language('auto','selectlang',1,0,0,1);
print '</td>';
示例14: include_once
// and no database access to do.
include_once("./inc.php");
$uri=preg_replace('/^http(s?):\/\//i','',$dolibarr_main_url_root);
$pos = strstr($uri, '/'); // $pos contient alors url sans nom domaine
if ($pos == '/') $pos = ''; // si $pos vaut /, on le met a ''
define('DOL_URL_ROOT', $pos); // URL racine relative
$langs->load("other");
$langs->load("help");
/*
* View
*/
pHeader($langs->trans("DolibarrHelpCenter").' '.DOL_VERSION, $_SERVER["PHP_SELF"]);
print $langs->trans("HelpCenterDesc1")."<br>\n";
print $langs->trans("HelpCenterDesc2")."<br>\n";
print '<br>';
print $langs->trans("ToGoBackToDolibarr",DOL_URL_ROOT.'/');
//print '<img src="dolibarr_logo2.png" height="22" alt="Dolibarr" title="Dolibarr">';
print '<br><br>';
$style1='color: #333344; font-size: 16px; font-weight: bold';
$style2='color: #5D4455; font-weight: bold;';
print "\n";
示例15: dolibarr_install_syslog
// Now we load forced value from install.forced.php file.
$useforcedwizard = false;
$forcedfile = "./install.forced.php";
if ($conffile == "/etc/dolibarr/conf.php") {
$forcedfile = "/etc/dolibarr/install.forced.php";
}
if (@file_exists($forcedfile)) {
$useforcedwizard = true;
include_once $forcedfile;
}
dolibarr_install_syslog("--- step1: entering step1.php page");
$error = 0;
/*
* View
*/
pHeader($langs->trans("ConfigurationFile"), "step2");
// Test if we can run a first install process
if (!is_writable($conffile)) {
print $langs->trans("ConfFileIsNotWritable", $conffiletoshow);
pFooter(1, $setuplang, 'jscheckparam');
exit;
}
// Check parameters
$is_sqlite = false;
if (empty($db_type)) {
print '<div class="error">' . $langs->trans("ErrorFieldRequired", $langs->transnoentities("DatabaseType")) . '</div>';
$error++;
} else {
$is_sqlite = $db_type === 'sqlite' || $db_type === 'sqlite3';
}
if (empty($db_host) && !$is_sqlite) {