mike12255 Posted January 19, 2009 Share Posted January 19, 2009 Because my CSS i cannot change do something like header ("Location: index.php"); when i try it, i get this error: Warning: Cannot modify header information - headers already sent by (output started at /home/sgiclan/public_html/testforum/reply.php:5) in /home/sgiclan/public_html/testforum/reply.php on line 66 here is my css: <!--- body { a:link, a:visited, a:active { text-decoration: none} font-family:Verdana, Sans-serif; color; #000000; font-size: 12px } input,textarea, select,{ color : #000000; font: normal 12px; border-collapse: collapse; border: 1px solid #000000; } .maintable {border: 0px ; width: 100%; padding: 0px; background-color: #FFFFFF} /*main table for forum*/ .regrow {font-family: Verdana,Sans-serif; color: #000000; font-weight: bold; background-color: #FFFFFF;font-size: 12px;} /*registration row, mainly here for symetry*/ .headline {font-family: Verdana,Sans-serif;font-weight: bold;color: #FFFFFF;background-color: #003366;font-size: 11px;} /*headline row, the first row that says forum name, topics, posts and such*/ .forumrow {font-family: Verdana,Sans-serif; color: #000000;background-color: #F2F2F2;font-size: 12px;} /*color of the forum rows*/ .mainrow a:link, a:visited, a:active { text-decoration: none;} .mainrow {font-family: Verdana,Sans-serif; color: #000000;background-color: #F2F2F2;font-size: 12px; a:link, a:visited, a:active { text-decoration: none}} /*color of the forum rows*/ .maintables{background-color: #FFFFFF; width: 85%; padding: 0px; border: 3px solid; cellspacing: no} /*main table for forum*/ ---> This is seriously limitting me does anyone know how to fix this? Quote Link to comment Share on other sites More sharing options...
Lodius2000 Posted January 19, 2009 Share Posted January 19, 2009 where is the header call in your php document Quote Link to comment Share on other sites More sharing options...
DarkSuperHero Posted January 19, 2009 Share Posted January 19, 2009 http://www.phpfreaks.com/forums/index.php/topic,37442.0.html <--read this... how does your css tie in with your php ? in the code provided neither ties in to each other... please be more specific on how they interact... Quote Link to comment Share on other sites More sharing options...
mike12255 Posted January 19, 2009 Author Share Posted January 19, 2009 well i start my php file like this: <?php include "connect.php"; //connection string include("include/session.php"); print "<link rel='stylesheet' href='style.css' type='text/css'>"; print "<table class='maintables'>"; print "<tr class='headline'><td>Reply</td></tr>"; print "<tr class='maintables'><td>"; and if my first if statment returns false it gose to: }else{ header ("Location: index.php"); } is that being specific enough or do you guys need more? Quote Link to comment Share on other sites More sharing options...
Lodius2000 Posted January 19, 2009 Share Posted January 19, 2009 i still dont see the header call in there mike but regardless I assume you want the print "<A href='index.php'>Click here</a> "; to be the header call in which case it cant because headers have already been sent in the first thing that outputs to the browser ie your first print command: print "<link rel='stylesheet' href='style.css' type='text/css'>"; EDIT: what does this page do, then I might be able to help more Quote Link to comment Share on other sites More sharing options...
mike12255 Posted January 19, 2009 Author Share Posted January 19, 2009 or sorry that was my temp fix i copy and pasted. Here is the header: }else{ header ("Location: index.php"); } this page displays a forum for users to enter a reply to a post however is the topic is locked and they are not an admin and try entering something like http://***-***.info/testforum/message.php?id=23 i want them to get redirected to the main forum page Quote Link to comment Share on other sites More sharing options...
Lodius2000 Posted January 19, 2009 Share Posted January 19, 2009 ok.... all of the prints need to be inside your if() that way if the if() is false then the header is the only thing sent to the browser, if it is true then the prints get sent Quote Link to comment Share on other sites More sharing options...
mike12255 Posted January 19, 2009 Author Share Posted January 19, 2009 oh ok, i get it now. So a header cannot overwrite a header kinda thing. Anyway got it working thanks again for the help mate. Quote Link to comment Share on other sites More sharing options...
Lodius2000 Posted January 19, 2009 Share Posted January 19, 2009 please click solved... o you did, sorry 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.