Bu alışkanlık oturumu ayarlamak?

0 Cevap php

Ben bunu localhost üzerinde büyük çalışma vardı, bu php giriş sistemi var, ben bir webhotel aldım ve şimdi artık çalışmıyor, ve bu yanlış giderse ben nerede bulamıyorum.

Ben hiç hata olsun.

Giriş sayfası index.php olduğunu ve oturum ve everythings ok if (hata / yanlış pw vb) zaman sonra home.php yönlendirileceksiniz.

Bu durum böyle değil. Ben giriş yaptığınızda, sadece üst index.php ve çıkışları bu yeniler:

Uyarı: başlık bilgileri değiştirilemiyor - zaten (httpd.www / OBZ / index.php: 2) tarafından gönderilen başlıklarını httpd.www / OBZ / index.php on line 221

on line 221 there's: header("Location: home.php");

Tamam, bu yüzden adresini girin elle home.php gitti. Şimdi home.php ben üstünde bu var:

include 'dbc.php';
page_protect();
echo "HELLO WORLD";

page_protect kontroller alışkanlık orada başka birini ayarlamaya oturumları veya cookie (Beni hatırladın), ama bir şey ayarlanmış eğer "Merhaba Dünya" içeriğini göreceksiniz eğer.

I home.php girdiğinizde Ama şu anda ben sadece bu alırsınız:

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at httpd.www/oBz/dbc.php:29) in httpd.www/oBz/dbc.php on line 69
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at httpd.www/oBz/dbc.php:29) in httpd.www/oBz/dbc.php on line 69
Warning: Cannot modify header information - headers already sent by (output started at httpd.www/oBz/dbc.php:29) in httpd.www/oBz/dbc.php on line 117

Hat 69 gidecekseniz session_start(), ve page_protect() fonksiyonunda ilk satırı;

hat 117 gidecekseniz header("Location: index.php") ve (session set / çerez kümesi) giriş değilseniz yönlendirmek için var

Sadece ne gerek comment değilse i, yeterli bilgi sağlanan, ve ben size bunu sağlamak için elimden geleni yapacağım umarım ..

Teşekkür ederim

Güncelleme:

Here is dbc.php: http://phpbin.net/x/999009567

** Index.php giriş ve nerede oturum kümeleri http://phpbin.net/x/1564167411 burada

**UPDATE: I now solved the header warning/errors but that was not the solution for the session issue!

**UPDATE: phpbin.net/x/25857430 the updated dbc.php, all the html that was in the dbc.php previously is in a new file top.php. I include the top.php file AFTER the doLogin function section in index.php, so there doesnt get any errors with the headers..

*** GÜNCELLEME: Sorun bir yerde burada: http://phpbin.net/x/557713701 şu neden onun her zaman index.php beni yönlendirme

0 Cevap