.:: Bots United ::.  
filebase forums irc server wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps waypoints yapb

Go Back   .:: Bots United ::. > Developer's Farm > General Programming
General Programming Help others and get yourself helped here!

Reply
 
Thread Tools
PHP Session Issue
Old
  (#1)
Ancient
PodBot MM's Laziest Waypointer
 
Ancient's Avatar
 
Status: Offline
Posts: 1,010
Join Date: Jan 2005
Location: Nebraska, United States of America
Default PHP Session Issue - 17-07-2008

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.


[Web Designer][Waypointer][Gamer]
CFE Games Administrator
[CFE]Games.com
[Never Trust the Untrusted]
   
Reply With Quote
Re: PHP Session Issue
Old
  (#2)
Ancient
PodBot MM's Laziest Waypointer
 
Ancient's Avatar
 
Status: Offline
Posts: 1,010
Join Date: Jan 2005
Location: Nebraska, United States of America
Default Re: PHP Session Issue - 17-07-2008

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.


[Web Designer][Waypointer][Gamer]
CFE Games Administrator
[CFE]Games.com
[Never Trust the Untrusted]
   
Reply With Quote
Re: PHP Session Issue
Old
  (#3)
Ancient
PodBot MM's Laziest Waypointer
 
Ancient's Avatar
 
Status: Offline
Posts: 1,010
Join Date: Jan 2005
Location: Nebraska, United States of America
Default Re: PHP Session Issue - 17-07-2008

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.


[Web Designer][Waypointer][Gamer]
CFE Games Administrator
[CFE]Games.com
[Never Trust the Untrusted]
   
Reply With Quote
Re: PHP Session Issue
Old
  (#4)
stefanhendriks
RealBot Author
 
stefanhendriks's Avatar
 
Status: Offline
Posts: 3,075
Join Date: Nov 2003
Location: Netherlands
Default Re: PHP Session Issue - 18-07-2008

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() ?


Author of RealBot, "Arrakis" and "Dune 2 - The Maker" | co-Founder of Bots-United | Fundynamic | Blog | E-Mail me
   
Reply With Quote
Re: PHP Session Issue
Old
  (#5)
Ancient
PodBot MM's Laziest Waypointer
 
Ancient's Avatar
 
Status: Offline
Posts: 1,010
Join Date: Jan 2005
Location: Nebraska, United States of America
Default Re: PHP Session Issue - 19-07-2008

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.


[Web Designer][Waypointer][Gamer]
CFE Games Administrator
[CFE]Games.com
[Never Trust the Untrusted]
   
Reply With Quote
Re: PHP Session Issue
Old
  (#6)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,569
Join Date: Jul 2004
Location: Bulgaria
Default Re: PHP Session Issue - 19-07-2008

What is the encoding of the files ? If you are using UTF try with UTF-8 without BOM.
   
Reply With Quote
Re: PHP Session Issue
Old
  (#7)
Ancient
PodBot MM's Laziest Waypointer
 
Ancient's Avatar
 
Status: Offline
Posts: 1,010
Join Date: Jan 2005
Location: Nebraska, United States of America
Default Re: PHP Session Issue - 21-07-2008

I have no idea how to change that.
I've been using Frontpage 2003.


[Web Designer][Waypointer][Gamer]
CFE Games Administrator
[CFE]Games.com
[Never Trust the Untrusted]
   
Reply With Quote
Re: PHP Session Issue
Old
  (#8)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,569
Join Date: Jul 2004
Location: Bulgaria
Default Re: PHP Session Issue - 21-07-2008

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.
   
Reply With Quote
Re: PHP Session Issue
Old
  (#9)
Ancient
PodBot MM's Laziest Waypointer
 
Ancient's Avatar
 
Status: Offline
Posts: 1,010
Join Date: Jan 2005
Location: Nebraska, United States of America
Default Re: PHP Session Issue - 22-07-2008

Oh my god, that is so stupid of an error.
Now I feel retarded.
Thanks. And I am in love with Notepad++
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.


[Web Designer][Waypointer][Gamer]
CFE Games Administrator
[CFE]Games.com
[Never Trust the Untrusted]
   
Reply With Quote
Re: PHP Session Issue
Old
  (#10)
Cheeseh
[rcbot]
 
Cheeseh's Avatar
 
Status: Offline
Posts: 362
Join Date: Dec 2003
Location: China
Default Re: PHP Session Issue - 22-07-2008

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.
   
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com