Post Reply  Post Thread 
Cookie problem
Author Message
stefo
Forumaš
***


Posts: 385
Group: Registered
Joined: Jun 2006
Status: Offline
Reputation: 3
Post: #1
Cookie problem

Pravim jednu skriptu koja se loguje koristeci
cookieje.
Evo sta mi izbaci.

Quote:
Warning: Cannot modify header information - headers already sent by (output started at D:\xampp\xampp\htdocs\78Dizajn.com Affiliate\login.php:1) in D:\xampp\xampp\htdocs\78Dizajn.com Affiliate\login.php on line 9

Warning: Cannot modify header information - headers already sent by (output started at D:\xampp\xampp\htdocs\78Dizajn.com Affiliate\login.php:1) in D:\xampp\xampp\htdocs\78Dizajn.com Affiliate\login.php on line 10


A evo koda:

Code:
<?

if(!file_exists("baza/korisnik-test.txt")) {
echo "<script>alert('Netacni podaci.');</script>";
echo "<meta http-equiv='refresh' content='0; URL=index.php'>";
exit;
}
else {
SetCookie("korisnik", $_POST['user'], time()+31536000, "/", "", "0");
SetCookie("sifra", md5($_POST['pass']), time()+31536000, "/", "", "0");
}

?>


Imam posebnu formu gdje se popune podaci i salje se na ovu stranicu ciji je zadatak da prebaci te podatke u cookieje na vrijeme od 365 dana.
Pomozite molim vas jer mi je hitno.


Kako kokoshka abortira?Snese jaje na beton.

http://www.stefosimple.co.nr
22-06-2008 02:04 PM
Visit this user's website Find all posts by this user Quote this message in a reply
tutorial
Redoviti posjetitelj
**


Posts: 168
Group: Registered
Joined: Jan 2007
Status: Offline
Reputation: 6
Post: #2
RE: Cookie problem

Ova se greška zna pojaviti ako encoding dokumenta nije postavljen na "utf-8 (without BOM)".


direktorij tutoriala seomag
22-06-2008 03:43 PM
Visit this user's website Find all posts by this user Quote this message in a reply
stefo
Forumaš
***


Posts: 385
Group: Registered
Joined: Jun 2006
Status: Offline
Reputation: 3
Post: #3
RE: Cookie problem

ANSI je kod mene


Kako kokoshka abortira?Snese jaje na beton.

http://www.stefosimple.co.nr
22-06-2008 04:20 PM
Visit this user's website Find all posts by this user Quote this message in a reply
tutorial
Redoviti posjetitelj
**


Posts: 168
Group: Registered
Joined: Jan 2007
Status: Offline
Reputation: 6
Post: #4
RE: Cookie problem

Ja sebi u Notepadu++ odaberem "Kodiraj u ANSI" i onda još "Kodiraj u UTF-8 (bez BOM)". Gdje ti se uopće nalazi taj kôd, imaš li još kôda na stranici?


direktorij tutoriala seomag
22-06-2008 11:02 PM
Visit this user's website Find all posts by this user Quote this message in a reply
stefo
Forumaš
***


Posts: 385
Group: Registered
Joined: Jun 2006
Status: Offline
Reputation: 3
Post: #5
RE: Cookie problem

Ne. Kazem ti imam posebnu formu za login,i kad neko upise podatke
i klikne na login salje ga na login.php gdje mi se nalazi gornji kod.

EDIT: Problem rijesen,bilo je do kodiranja.
Kada spremam PHP fajlove uvijek su ANSI enkodirani
medjutim ovaj je bio UTF-8 i ja da slucajno nisam okrenuo na
Save As ne bi ni saznao. Hvala tutorial puno,koristan savjet Palac-gore


Kako kokoshka abortira?Snese jaje na beton.

http://www.stefosimple.co.nr

This post was last modified: 22-06-2008 11:27 PM by stefo.

22-06-2008 11:14 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: