ecabrera Posted January 2, 2012 Share Posted January 2, 2012 ok i read the header part but i sure i did it rite but its givong me those erros <?php session_start(); $username = $_SESSION['username']; ?> <?php require "scripts/connect.php"; if($_POST['submitbtn']){ $body = mysql_real_escape_string($_POST['area1']); if($body){ $query = mysql_query("UPDATE history SET body ='$body'"); echo $msg = "UPDATED GOOD"; header('location: http://www.rbrhslsp.org/rbrhsadmins/edithistory'); }else $msg = "Please fill in the body"; } mysql_close(); ?> <?php require "scripts/connect.php"; $query = mysql_query("SELECT * FROM history"); $rows = mysql_fetch_assoc($query); $body = stripslashes($rows['body']); mysql_close(); ?> <?php require "header.php"; ?> <?php if ($username){?> <div id="leftContent"> <h4> Your page </h4> <?php echo $msg;?> <form action='edithistory' method='post'> <textarea style="height: 100px; width:490px;" name="area1" cols="58"><?php echo $body;?></textarea> <input type='submit' name='submitbtn' value='Submit' /> </form> </div> Quote Link to comment https://forums.phpfreaks.com/topic/254225-are-headers-smarter-than-me/ Share on other sites More sharing options...
litebearer Posted January 2, 2012 Share Posted January 2, 2012 echo $msg = "UPDATED GOOD"; header('location: http://www.rbrhslsp.org/rbrhsadmins/edithistory'); You CANNOT output ANYTHING before headers, else you WILL get error Quote Link to comment https://forums.phpfreaks.com/topic/254225-are-headers-smarter-than-me/#findComment-1303446 Share on other sites More sharing options...
ecabrera Posted January 2, 2012 Author Share Posted January 2, 2012 thanks alot Quote Link to comment https://forums.phpfreaks.com/topic/254225-are-headers-smarter-than-me/#findComment-1303447 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.