PunjabHaker Posted February 6, 2007 Share Posted February 6, 2007 i have 2 files: index.php and s.php the first lines in both files are: <?php session_start(); ?> in the file s.php i got this error: Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at D:\Web Design\clothes store\accesories.php:1) in D:\Web Design\clothes store\s.php on line 2 Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at D:\Web Design\clothes store\accesories.php:1) in D:\Web Design\clothes store\s.php on line 2 please help where am i wrong ? Quote Link to comment Share on other sites More sharing options...
DeathStar Posted February 6, 2007 Share Posted February 6, 2007 that wont help much.. can you paste the script here.. Quote Link to comment Share on other sites More sharing options...
PunjabHaker Posted February 6, 2007 Author Share Posted February 6, 2007 the files index.php and s.php start with the same lines i start the session <?php session_start(); ?> in the file s.php i got that error what can be wrong ? the code is just html codes with images, etc where can be the error ? Quote Link to comment Share on other sites More sharing options...
DeathStar Posted February 6, 2007 Share Posted February 6, 2007 try just removing the session_start(); and if it html codes why is it php? Quote Link to comment Share on other sites More sharing options...
PunjabHaker Posted February 6, 2007 Author Share Posted February 6, 2007 because i use some session variables to print something in index.php i have $_SESSION['word'] = "Hello"; and i want to print it in s.php like print $_SESSION['word']; please help Quote Link to comment Share on other sites More sharing options...
DeathStar Posted February 6, 2007 Share Posted February 6, 2007 oh ok.. then dont remove the session.... lol anything being sent from that file? Quote Link to comment Share on other sites More sharing options...
PunjabHaker Posted February 6, 2007 Author Share Posted February 6, 2007 both files s.php and index.php start with that code i can't understand why it doesn't work Quote Link to comment Share on other sites More sharing options...
DeathStar Posted February 6, 2007 Share Posted February 6, 2007 is it a login page? Quote Link to comment Share on other sites More sharing options...
PunjabHaker Posted February 6, 2007 Author Share Posted February 6, 2007 no in index.php i have: $_SESSION['backlink'] = "eo.php"; in s.php i have a back link <a href='".$_SESSION['backlink']."'>Go Back</a> and i want it to go to back page, this mean index.php Quote Link to comment Share on other sites More sharing options...
DeathStar Posted February 6, 2007 Share Posted February 6, 2007 do you have $_SESSION['backlink'] = "eo.php"; in s.php ? Quote Link to comment Share on other sites More sharing options...
PunjabHaker Posted February 6, 2007 Author Share Posted February 6, 2007 no so i want in s.php to make a link that sent me to back page how can i do that ? Quote Link to comment Share on other sites More sharing options...
DeathStar Posted February 6, 2007 Share Posted February 6, 2007 how do you mean? Quote Link to comment Share on other sites More sharing options...
PunjabHaker Posted February 6, 2007 Author Share Posted February 6, 2007 how what ? i need to make a back link Quote Link to comment Share on other sites More sharing options...
DeathStar Posted February 6, 2007 Share Posted February 6, 2007 to a page? Quote Link to comment Share on other sites More sharing options...
PunjabHaker Posted February 6, 2007 Author Share Posted February 6, 2007 man please do not reply if you don't know how to do it thanks for understanding Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted February 6, 2007 Share Posted February 6, 2007 here, punjabhacker, read this article, maybe it will clear some stuff up for you: http://www.phpfreaks.com/forums/index.php/topic,37442.0.html Quote Link to comment Share on other sites More sharing options...
PunjabHaker Posted February 6, 2007 Author Share Posted February 6, 2007 still can't fucking understand why it doesn't work could it be from the php ? i have php5 installed Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted February 7, 2007 Share Posted February 7, 2007 no place for swearing, keep your temper controlled. impatience leads to the dark side of the force... (thats me quoting yoda ) now... this is what your s.php page should look like: <?php session_start(); echo "<a href='".$_SESSION['backlink']."'>Go Back</a>"; ?> and this is what your index.php page should look like: <?php session_start(); $_SESSION['backlink'] = "index.php"; echo "<a href='s.php'>Go to S.php</a>"; ?> with your code make sure there are no whitespaces between the absolute top of your page and <?php and session_start(); must be directly after it. Quote Link to comment Share on other sites More sharing options...
corbin Posted February 7, 2007 Share Posted February 7, 2007 Edit: someone beat me too it... Didn't see the second page. 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.