GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Php problem... WTF! (https://gfy.com/showthread.php?t=58276)

chodadog 04-26-2002 06:01 AM

Php problem... WTF!
 
ok, i've been working my ass off trying to get this damn site working.. then finally, it's done! finally fixed all the bugs.. or so i thought!

I try to login to my admin section, and when i get to the index.php of the admin directory, i get this message:

Warning: Cannot send session cookie - headers already sent by (output started at /home/virtual/site5/fst/var/www/get_env.php:1) in /home/virtual/site5/fst/var/www/html/tagadmin/index.php on line 14

What in fuck's name does that mean!
And how do i fix it?

railz 04-26-2002 06:02 AM

What script(s) are you using?

chodadog 04-26-2002 06:05 AM

It's called kDDL. It's a direct downloads script (intended for warez)
I got it back when i was a warez webmaster. But it's pretty much idealy suited for the TGP i wanna run, so i figured.. hey.. why not..

sweandy 04-26-2002 06:07 AM

It probably sent some text or blank space before you do a header("location"); redirect or similair..

chodadog 04-26-2002 06:09 AM

hmm.. any idea how to fix it though? :D

sweandy 04-26-2002 06:12 AM

Check the html source in your browser if it outputs some strange text before the php warning, could even be " " blank space etc that you miss at first.

chodadog 04-26-2002 06:14 AM

This is the source (after i've attempted to login, so there's another error)

PHP Code:

<a href=""></a><br>
<
b>Warning</b>:  Cannot send session cookie headers already sent by (output started at /home/virtual/site5/fst/var/www/get_env.php:1in <b>/home/virtual/site5/fst/var/www/html/tagadmin/index.php</bon line <b>14</b><br>
<
br>
<
b>Warning</b>:  Cannot send session cache limiter headers already sent (output started at /home/virtual/site5/fst/var/www/get_env.php:1in <b>/home/virtual/site5/fst/var/www/html/tagadmin/index.php</bon line <b>14</b><br>
<
br>
<
b>Warning</b>:  Cannot add header information headers already sent by (output started at /home/virtual/site5/fst/var/www/get_env.php:1in <b>/home/virtual/site5/fst/var/www/html/tagadmin/index.php</bon line <b>41</b><br


railz 04-26-2002 06:17 AM

http://www.faqts.com/knowledge_base/...d/14388/fid/51

Quote:

quote from the amnual page for setcookie():

setcookie() defines a cookie to be sent along with the rest of the
header information. Cookies must be sent before any other headers are
sent (this is a restriction of cookies, not PHP). This requires you to
place calls to this function before any <html> or <head> tags.
HTML tags in the wrong place?

sweandy 04-26-2002 06:20 AM

Yep seems like you put the stuff in wrong order.. set session cookie first then html output.

chodadog 04-26-2002 06:29 AM

Cheers guys. I'll see if i can fix it now :)

chodadog 04-26-2002 06:34 AM

ok.. i'm stumped..

this is from the index.php of the admin directory:

PHP Code:


<?php
$inn 
false;

require 
"../../config.php";
require 
"../../db.inc.php";
require 
"../../get_env.php";
require 
"sec/session.php";

session_start();

And this is from get_env.php:

PHP Code:


<?php

$env_q 
"SELECT * FROM $mysql_tb_info";
if (!
$env_get mysql_query($env_q$mysql_conn))
    die(
$mysql_error_msg."<br><br>".mysql_error());
list(
$user$pass$name$url$email$types$spam_protect$code_check$files_max$files_page$link_gateway$link_show_in$link_show_out$link_show_zero$link_cols$link_max$link_layout
$date_format$layout_ddl$layout_ddl_rows$layout_ddl_top) = mysql_fetch_row($env_get);

$files_page2 $files_page;
$type explode("|"$types);
$link_layout explode("|"$link_layout);
$layout_ddl explode("|"$layout_ddl);
?>

I haven't got a clue.. i suck so very bad with php :(

railz 04-26-2002 06:36 AM

What's on line 14 of index.php?

chodadog 04-26-2002 06:43 AM

PHP Code:

echo "Logged out!<br><br>\n"


sweandy 04-26-2002 07:05 AM

No errors in config.php or db.inc.php that outputs something?

chodadog 04-26-2002 07:08 AM

Hey.. i dunno how it happened.. but the admin index.php was modified.. i'm not sure if that's supposed to happen.. but anyways. i just replaced hte index.php from admin and the get_env.php from the originals on my hard disk, and it's fixed the problem..

Any idea why this happened in the first place? and how do i prevent it from happening. cheers

sweandy 04-26-2002 07:19 AM

No idea. But if you have any more php problems hit me up on icq.


All times are GMT -7. The time now is 01:31 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123