PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
Ree
Forum Regular
Posts: 592 Joined: Fri Jun 10, 2005 1:43 am
Location: LT
Post
by Ree » Mon Sep 26, 2005 2:07 pm
Is it fine to use any statements (that don't output anything) BEFORE using session_start(), such as this:
Code: Select all
<?php
define('path', 'value');
include(path . '/file.php');
session_start();
$_SESSION['msg'] = 'Is that ok?';
?>
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Mon Sep 26, 2005 2:09 pm
so long as there is no output, yes.
shiznatix
DevNet Master
Posts: 2745 Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:
Post
by shiznatix » Mon Sep 26, 2005 2:10 pm
yes. as long as nothing is outputted to the browser first, not even a blank space
edit: im too slow
Ree
Forum Regular
Posts: 592 Joined: Fri Jun 10, 2005 1:43 am
Location: LT
Post
by Ree » Mon Sep 26, 2005 2:11 pm
Good then.
off-topic: feyd, you're alive answering machine
. If you see orange
feyd name as an online user, you can almost 100% be sure you'll get the answer in no time. You're doing a great job, really.
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Mon Sep 26, 2005 2:24 pm
thanks.. too bad I don't get paid for it.
Charles256
DevNet Resident
Posts: 1375 Joined: Fri Sep 16, 2005 9:06 pm
Post
by Charles256 » Mon Sep 26, 2005 3:48 pm
i'm telling you.i sit online praying i can beat him to hte punch.