Hello,
When I use:
Apache 1.x.x
PHP 4.3.1
MySQL 3.23
all working is OK, but I use
Wamp5-1.6.0 dont wok.
I have script:
<?php
// Kreiranje sesije za korisnika
session_start();
// "Smjestanje" promjenjive imena baze podataka koja se dobije iz prijavljujuce
// datoteke index.php u sesiju
$CfgDBName = $_REQUEST['y'];
$_SESSION['y'] = $_REQUEST['y'];
// Promjenjive koje se dobijaju iz datoteke index.php
$username = $HTTP_POST_VARS["username"];
$password = $HTTP_POST_VARS["password"];
// Potrebna zaglavlja
require("./include/user.h.php"
;
require("./include/messages.h.php"
;
require("./include/display.h.php"
;
// Why are there two "new" calls here? Is there some issue with creating a
// User object with an invalid username? If that's the case, then we should
// be able to solve the problem using the "exists()" method of the user class.
$user = new User();
$user = new User($username);
// Provjera za ispravnost korisnickog imena i lozinke
if($user->authenticate($username, $password) && $username != ""
{
// Kriptovanje lozinke
$password = md5($password);
// Postavljanje unesenog korisnickog imena i lozinke u globalne promjenjive
$MERCEDESBENZName = $username;
$MERCEDESBENZPass = $password;
// Prijavljivanje se zapisuje u drvo poruka
setLogMessages($user->getFullname(), "\$autoline008"
;
// Redirekcija na index.php u poddirektoriju data
header("Location: ./data/"
;
}
else
{
// Neuspijeh u prijavi se zapisuje u drvo poruka
setLogMessages($username, "\$al005"
;
// Pozivanje sablonskih datoteka
$cs = implode(" ", file("./template/error.html"
);
$cs = str_replace("{title}", $al005, $cs);
$cs = str_replace("{ErrorMessage}", "<font color='red'>".$al005."</font>", $cs);
$cs = str_replace("{ContactPerson}", $al002, $cs);
echo $cs;
}
?>
Web borwser:
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at D:\www\login.php:1) in D:\www\login.php on line 1
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at D:\www\login.php:1) in D:\www\login.php on line 1