.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   General Programming (http://forums.bots-united.com/forumdisplay.php?f=25)
-   -   PHP Session Issue (http://forums.bots-united.com/showthread.php?t=6854)

Ancient 17-07-2008 18:36

PHP Session Issue
 
At cfegames.com/login.php there is a session and headers error that has been annoying me and eluding me for months. I've issolated the issue and found it to be within 3 files.

Mysql php
database php
login php

I checked all three, no spaces are before or after the <?php ?> tags.

I had a headers list display, it showed normal powered by: php-x-version 2.5.2 and something about content-type: x or something similar.

It appears on all pages, but does not bother the others. I'm assuming it may be a cache issue, but I've delete the cache before, and still the problem presists.

I'm using Smarty template engine and everything in the portal seems to work but the login. It says can't send session_start(), however, you are able to login. Although, if you select remember me, the cookies will not submit because of the headers already sent.

I took the login.php from another website I made that had the same portal system, and moving to cfegames and it still had the error, however, the error does not exist in the website I took it from. This seems very complicated and it is frustrating me very much. I checked the CHMOD and it is 644 like it should be. This has stumped U Tews from the Smarty forum and he could not assist me. I am hoping maybe someone here could assist with this probably very simple issue.

Ancient 17-07-2008 19:14

Re: PHP Session Issue
 
I have currently commented everything but the following in log_in.php

PHP Code:

<?php
session_start
();
header("Cache-Control: Private");
print_r(headers_list());
?>

It shows up as: http://www.CFEGames.com/log_in.php
I'm starting to think, maybe it is a server thing or a folder property. I don't know if it will seem professional if I have to create a new file and call it signin.php or something like that. But whatever works, I guess I'll try it.

Zend analyzed the login.php and did find any errors, however when I use the zend browser, the errors poped up.

Ancient 17-07-2008 19:34

Re: PHP Session Issue
 
No errors appear in signin.php

www.CFEGames.com/signin.php

I rewrote the login and saved it as signin.php.
I'm going to contact tech support. :s For once it won't be a hosting question.

stefanhendriks 18-07-2008 09:25

Re: PHP Session Issue
 
hmm, i have had this before, but i can't think of the sollution by heart now. Could you try to remove the header() function as well? So you only have the session_start() ?

Ancient 19-07-2008 04:13

Re: PHP Session Issue
 
Same thing would happen if I just leave session_start().
I changed the file name to signin.php now, the setcookie won't work.
I even have the header() after the cookie being set.
I will have to investigate further.

The Storm 19-07-2008 13:38

Re: PHP Session Issue
 
What is the encoding of the files ? If you are using UTF try with UTF-8 without BOM.

Ancient 21-07-2008 17:52

Re: PHP Session Issue
 
I have no idea how to change that.
I've been using Frontpage 2003.

The Storm 21-07-2008 18:19

Re: PHP Session Issue
 
Download Notepad++ (it's free), open the file and from the encoding menu(sorry my version is on bulgarian so I can't tell you what for sure is the name of the menu) choose the option "UTF-8 Without BOM", save the file and check if the error will dissapear. :)

Ancient 22-07-2008 02:06

Re: PHP Session Issue
 
Oh my god, that is so stupid of an error.
Now I feel retarded.
Thanks. And I am in love with Notepad++ :D
People have been having this error for years.
I noticed the error was traveling when I changed some files to UTF-8 without BOM.

Good fix. TY.

Cheeseh 22-07-2008 15:01

Re: PHP Session Issue
 
just another recommended program to use (and free)

try Eclipse and PhpEclipse plugin

thats what I always use

but notepad++ looks great I think I will try it.


All times are GMT +2. The time now is 06:23.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.