|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
aack! session help
i recently came upon that very ugly session error when trying to make a verification script to "include" on all of my administration pages. any help would be appreciated! (PS: all of the objects are in perfect working order!)
The error is... Warning: Cannot send session cache limiter - headers already sent (output started at /home/gamequb/public_html/news/newstemp/mysql.inc:156) in /home/gamequb/public_html/news/newstemp/valiUser.inc on line 5 and the code is.... <? $adminsql->connect(); session_start(); session_register("username"); session_register("password"); $adminsql->query("SELECT * FROM users WHERE user = \"$username\" AND pass = password(\"$password\")"); if ($adminsql->numrows() == 0 || (!isset($username) && !isset($password))) { session_unregister("username"); session_unregister("password"); $newspage->title = "Gamequbed Login"; $newspage->bgcol = "#FFFFFF"; $newspage->fg = "#E4E4E4"; $newspage->bg = "#F0F0F0"; $newspage->bordercol = "#C0C0C0"; $newspage->mainlink = "#666699"; $newspage->font = "MS Sans Serif"; $newspage->maintexts = "1"; $newspage->header(); $newspage->body(); $newspage->login("000000","000000","000000"); exit; } while ($adminsql->next_record()) { $access = $adminsql->record['level']; $newspage->bgcol = $adminsql->record['bgcolor']; $newspage->bordercol = $adminsql->record['bordercol']; $newspage->fg = $adminsql->record['foreground']; $newspage->bg = $adminsql->record['background']; $newspage->mainlink = $adminsql->record['mainlink']; $newspage->font = $adminsql->record['font']; $newspage->maintexts = $adminsql->record['maintexts']; } ?> |
|
#2
|
||||
|
||||
|
That error pretty much explains itself...
In the file valiUser.inc (line 5) you include the file mysql.inc which outputs something (whitespace or some other character) on line 156. Or is it the other way around? Anyway, check those files around the mentioned lines. Now when using sessions and/or cookies you can't output anything to your screen before you call session_start, session_register or setcookie. That includes whitespace, linefeeds etc. So remove all of those and it should work. //NoXcuz
__________________
UN*X is sexy! who | grep -i blonde | date; cd ~; unzip; touch; strip; finger; mount; gasp; yes; uptime; umount; sleep |
|
#3
|
|||
|
|||
|
thanks!
thanks alot for the help; it was driving me crazy! it turns out there was an errorneous function in mysql.inc which i had to remove.
Last edited by CoolAsIce : July 19th, 2002 at 09:18 PM. |
![]() |
| Viewing: Dev Shed Forums > Other > Beginner Programming > aack! session help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|