Ehi guys sono in possesso di uno script realizzato completamente in PHP.
Gli errori sono 3:
Il primo e quando cerco di collegarmi al sito e dice questo:
Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\sys\config\db.inc.php:1) in C:\xampp\htdocs\html\page.login.inc.php on line 94
Lo script della pagina page.login.inc.php è:
<?php
if (isset($i_am))
{
if ($i_am->GetFriendsCount() > 0)
{
header("Location: /account/feed");
}
else
{
header("Location: /");
}
}
$page_id = "login";
$oVkontakte = new vkontakte($dbo);
$oFacebook = new facebook($dbo);
if(isset($_GET['action']))
{
switch($_GET['action'])
{
case 'login':
{
$oVkontakte->logIn();
break;
}
case 'facebook':
{
$oFacebook->logIn();
break;
}
default:
header("Location: /login");
break;
}
}
if (isset($app->login))
{
$login = $app->login;
$passw = $app->passw;
}
else
{
$login = '';
$passw = '';
}
$error = false;
if (!empty($_POST))
{
$error = true;
$login = (isset($_POST['user_login'])) ? $_POST['user_login'] : '';
$passw = (isset($_POST['user_passw'])) ? $_POST['user_passw'] : '';
$save_passw = (isset($_POST['remember_me'])) ? $_POST['remember_me'] : '';
$token = (isset($_POST['token'])) ? $_POST['token'] : '';
$referer = (isset($_POST['referer'])) ? $_POST['referer'] : '';
$passw = htmlspecialchars($passw);
$login = htmlspecialchars($login);
if (isset($_SESSION['token']))
{
if ($token === $_SESSION['token'])
{
if ($app->CheckUser($login,$passw))
{
if ($save_passw === "on")
{
@setcookie('autologin',"1",time()+7*24*3600,"/");
@setcookie('passw',"$passw",time()+7*24*3600,"/");
@setcookie('login',"$login",time()+7*24*3600,"/");
}
else
{
@setcookie('autologin',"0",time()+7*24*3600);
}
unset($_SESSION['token']);
$app->LoginUser($login, $passw);
$pos = strpos($referer, APP_URL);
if ($pos === false)
{
header("Location: /");
}
else
{
header("Location: {$referer}");
}
exit;
}
}
}
}
GenGlobalToken();
$css_files = array("style.css");
$page_title = $TEXT['menu-login']." | ".APP_TITLE;
include_once("../html/common/header.inc.php");
?>
<body class="noface-theme">
<?php
include_once('../html/common/topbar.inc.php');
?>
<div id="page-outer">
<div class="wrapper-main">
<div class="left-sidebar">
<div class="usermenu">
<?php
include_once("../html/common/leftbar.inc.php");
?>
</div>
</div>
<div class="profile-wrapper noface">
<div class="page-header"><?php echo $TEXT['menu-login']; ?></div>
<div class="questions-content">
<div class="adv-data">
<span style="margin-top: -10px;" class="warning center">
<p><?php echo $TEXT['btn-login-withtext']; ?></p>
<br>
<div class="share1 fb" style="margin-top: 0px; display: inline-block;">
<a style="" href="/facebook/?action=login">Facebook</a>
</div>
<div class="share1 tw" style="margin-top: 0px; display: inline-block;">
<a style="" href="/tw_session">Twitter</a>
</div>
<div class="share1 vk" style="margin-top: 0px; display: inline-block;">
<a style="" href="/vkontakte/?action=login">VK</a>
</div>
<div class="share1 gl" style="margin-top: 0px; display: inline-block;">
<a style="" href="/gl_session">Google+</a>
</div>
</span>
</div>
<?php
if ($error)
{
?>
<div class="adv-data">
<a id="adv-remove" class="delete" href="javascript:;"></a>
<span class="error center"><?php echo $TEXT['error-login']; ?></span>
</div>
<?php
}
?>
<div class="content-main">
<form id="loginform1" class="form-horizontal login_form" method="POST" action="/login" autocomplete="off">
<input type="hidden" name="token" value="<?php echo $_SESSION['token']; ?>">
<?php
if (isset($_SERVER['HTTP_REFERER']))
{
?>
<input type="hidden" name="referer" value="<?php echo $_SERVER['HTTP_REFERER']; ?>">
<?php
}
?>
<fieldset id="userlogin_fieldset" class="control-group">
<label for="user_login" class="control-label"><?php echo $TEXT['username'] ?>:</label>
<div class="controls">
<input id="user_login" tabindex="1" maxlength="16" name="user_login" type="text" value="<?php echo $login; ?>">
</div>
</fieldset>
<fieldset id="userpassw_fieldset" class="control-group">
<label for="user_passw" class="control-label"><?php echo $TEXT['passw']; ?>:</label>
<div class="controls">
<input id="user_passw" tabindex="2" maxlength="16" name="user_passw" type="password" value="<?php echo $passw; ?>">
<p><a class="top-10" href="/remind"><?php echo $TEXT['label-forgot']; ?></a></p>
</div>
</fieldset>
<hr>
<fieldset id="usercaptcha_fieldset" class="control-group">
<div class="controls">
<label for="remember_me2"><input id="remember_me2" tabindex="3" type="checkbox" name="remember_me" class="remember_me"><span style="margin-left: 5px;font-size: 13px;"><?php echo $TEXT['label-remember']; ?></span></label>
</div>
</fieldset>
<div class="form-actions">
<button id="settings_save" tabindex="4" class="prj-button prj-button-blue" type="submit"><?php echo $TEXT['btn-login']; ?></button>
</div>
</form>
</div>
</div>
</div>
<div class="small-footer">
<?php
include_once("../html/common/footer.inc.php");
?>
</div>
</div>
</div>
</body>
</html>
Gli altri errori ve gli metto come "risposta" perchè ho superato il massimo di scrittura![]()