Jump to content

[SOLVED] header problem...


JJohnsenDK

Recommended Posts

Hey

 

i get this error:

Warning: Cannot modify header information - headers already sent by (output started at C:\Programmer\xampp\xampp\htdocs\test\login\config.php:29) in C:\Programmer\xampp\xampp\htdocs\test\login\log_out.php on line 14

 

config.php script:

<?php
set_include_path('../../../php/pear/');
include ('DB.php');

$type 		= "mysql";

$host		= "localhost";	//mySQL server

$user		= "root";	//mySQL brugernavn

$pass		= "";	//mySQL kodeord

$database	= "login";	//mySQL database

//Åbner Forbindelsen til mysql serveren og vælger database

$dsn = "$type://$user:$pass@$host/$database";

$dbconn = DB::connect($dsn);

if (DB::isError($dbconn)) {
die($dbconn->getMessage());
}

require('check_login.php');

?>

 

line 29 is empty, the last line in script after the php closer ?>

 

log_out.php script:

 

<?php
require('config.php');    // database connect script.

if ($logged_in == 0) {
    die('You are not logged in so you cannot log out.');
}

unset($_SESSION['username']);
unset($_SESSION['password']);
// kill session variables
$_SESSION = array(); // reset session array
session_destroy();   // destroy session.
// redirect them to anywhere you like.
header("Location: login.php");
?>

 

line 14 is the header line...

 

hope someone can help out.

Link to comment
https://forums.phpfreaks.com/topic/39607-solved-header-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.