cooldude832 Posted September 7, 2007 Share Posted September 7, 2007 Is there a way without code <?php session_start();?> ontop of each page to get that affect? Quote Link to comment Share on other sites More sharing options...
teng84 Posted September 7, 2007 Share Posted September 7, 2007 nope i guess session start need to be declared on each page because it acts like a basket where the value of that session is being fetch Quote Link to comment Share on other sites More sharing options...
Liquid Fire Posted September 7, 2007 Share Posted September 7, 2007 just include it is a header or config(or any file that is including in every file. I have it in a class and i have the class created in my config file on my own framework. Quote Link to comment Share on other sites More sharing options...
teng84 Posted September 7, 2007 Share Posted September 7, 2007 just include it is a header or config(or any file that is including in every file. I have it in a class and i have the class created in my config file on my own framework. including is same as declaring session start! Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted September 7, 2007 Author Share Posted September 7, 2007 Is there a way to setup in .htaccess a script to run on everypage. I know there has to be a way because my stats have to do something. Quote Link to comment Share on other sites More sharing options...
teng84 Posted September 7, 2007 Share Posted September 7, 2007 i haven't heard something like that have you tried cookie Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted September 7, 2007 Author Share Posted September 7, 2007 cookies? that has nothing to do with this. Quote Link to comment Share on other sites More sharing options...
teng84 Posted September 7, 2007 Share Posted September 7, 2007 yes, but the way i know session it should always be declared hmm i dont think htaccess can do this Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted September 7, 2007 Author Share Posted September 7, 2007 Then how do all my site statistics work because they track stats on each page being hit, unless apache returns that data somehow. Quote Link to comment Share on other sites More sharing options...
teng84 Posted September 7, 2007 Share Posted September 7, 2007 DB? Quote Link to comment Share on other sites More sharing options...
trq Posted September 7, 2007 Share Posted September 7, 2007 Is there a way without code <?php session_start();?> ontop of each page to get that affect? Yes. See the session.auto_start directive within your php.ini Is there a way to setup in .htaccess a script to run on everypage. .htaccess is parsed upon every request to the directory containing the .htaccess file. Then how do all my site statistics work because they track stats on each page being hit, unless apache returns that data somehow. Most stat programs query the Apache logs. Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted September 7, 2007 Author Share Posted September 7, 2007 Is that an issue, if everyone who visits the site will need sessions to do anything, setting it to auto start that is. Quote Link to comment Share on other sites More sharing options...
btherl Posted September 7, 2007 Share Posted September 7, 2007 Is that an issue, if everyone who visits the site will need sessions to do anything, setting it to auto start that is. That depends on your site. If you have a lot of traffic on pages that don't use sessions, then you're probably better off starting them explicitly on those pages which do need them. Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted September 7, 2007 Author Share Posted September 7, 2007 well since you can't do anything on my site, except login/register without sessions then i think auto_start will be the right move also it is anonying because there is no right way to do <?php session_start(); ?> without violating w3 compliance. Quote Link to comment Share on other sites More sharing options...
trq Posted September 7, 2007 Share Posted September 7, 2007 there is no right way to do <?php session_start(); ?> without violating w3 compliance. What on earth are you talking about? Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted September 7, 2007 Author Share Posted September 7, 2007 okay if i have a doc following xhtml stricness you can't have text in the prolouge, but if the <?php session_start(); ?> is placed after the doc type decleartion it says error header already sent Quote Link to comment Share on other sites More sharing options...
trq Posted September 7, 2007 Share Posted September 7, 2007 Place it beforehand, it doesn't output anything. Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted September 7, 2007 Author Share Posted September 7, 2007 so like <?php session_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> That technically isn't compliance because it be in the prolouge of the file or <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <?php sesion_start(); ?> //Declare some headers via <html lang="en"> or some other method ?> that does work but i have gotten header's already sent errors with this Quote Link to comment Share on other sites More sharing options...
btherl Posted September 7, 2007 Share Posted September 7, 2007 It IS in compliance, because php code is not part of the document. It's part of the php source script. Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted September 7, 2007 Author Share Posted September 7, 2007 That makes sense and I'll agree, but nether less their tester still gives prolouge errors. Quote Link to comment Share on other sites More sharing options...
trq Posted September 7, 2007 Share Posted September 7, 2007 That makes sense and I'll agree, but nether less their tester still gives prolouge errors. BS. Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted September 7, 2007 Author Share Posted September 7, 2007 I've gotten errors using the upload a file version not the insert a url on the validator on w3 (I assume you are familiar with it). I'm sure they address this issue in the consornoium and declare that scripting of anything preprocessor can exist pre the doc type as long as it doesn't produce any output. Quote Link to comment Share on other sites More sharing options...
trq Posted September 7, 2007 Share Posted September 7, 2007 I've gotten errors using the upload a file version The upload file version expects html, xhtml documents of pure markup. I doubt it would be expecting any php script which won't end up in the output. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.