BillyBoB Posted July 13, 2006 Share Posted July 13, 2006 nothing Quote Link to comment https://forums.phpfreaks.com/topic/14523-nothing/ Share on other sites More sharing options...
akitchin Posted July 13, 2006 Share Posted July 13, 2006 is it so hard for people on these forums to at least glance at the pinned topics first?[url=http://www.phpfreaks.com/forums/index.php/topic,37442.0.html]http://www.phpfreaks.com/forums/index.php/topic,37442.0.html[/url]see that topic for your answer. Quote Link to comment https://forums.phpfreaks.com/topic/14523-nothing/#findComment-57534 Share on other sites More sharing options...
BillyBoB Posted July 13, 2006 Author Share Posted July 13, 2006 then why does it still happen after i followed that Quote Link to comment https://forums.phpfreaks.com/topic/14523-nothing/#findComment-57538 Share on other sites More sharing options...
akitchin Posted July 13, 2006 Share Posted July 13, 2006 well it's hard to say, since you've edited your post to remove everything, but i'd guess that you've still got output happening before you run setcookie(). what does the page look like up to and including those lines? Quote Link to comment https://forums.phpfreaks.com/topic/14523-nothing/#findComment-57540 Share on other sites More sharing options...
BillyBoB Posted July 13, 2006 Author Share Posted July 13, 2006 in the post that u sent me to said it i had to send output to put ob_start(); at the top and i did Quote Link to comment https://forums.phpfreaks.com/topic/14523-nothing/#findComment-57542 Share on other sites More sharing options...
BillyBoB Posted July 13, 2006 Author Share Posted July 13, 2006 [code]<?phpob_start();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><?phpob_start();include("config.php");if (!$logged[username]){if(!$_POST[login]){echo("<center><form method=\"POST\">Username:<br /><input type=\"text\" size=\"15\" maxlength=\"50\" name=\"username\"><br />Password:<br /><input type=\"password\" size\"15\" maxlength=\"50\" name=\"password\"><br /><input type=\"submit\" name=\"login\" value=\"Login\"><br /><br />Not a member yet?<br /><a href=\"register.php\">Register</a><br /><a href=\"lostpass.php\">Lost Pass?</a></form></center>");}if($_POST[login]){$username=$_POST['username'];$password = md5($_POST[password]);$info = mysql_query("SELECT * FROM users WHERE username = '$username'") or die(mysql_error());$data = mysql_fetch_array($info);if($data[password] != $password) {echo("Wrong password or username!");}else{$query = mysql_query("SELECT * FROM users WHERE username = '$username'") or die(mysql_error());$user = mysql_fetch_array($query);ob_flush();setcookie("id", $user[id],time()+(60*60*24*5), "/", "");setcookie("pass", $user[password],time()+(60*60*24*5), "/", "");ob_flush();echo ("<meta http-equiv=\"Refresh\" content=\"0; URL=http://dreamshowstudios.net\"/>Thank You! You will be redirected");}}}else{echo("<center>Welcome <b>$logged[username]</b>!<br />- <a href=\"editprofile.php\">Edit Profile</a><br />- <a href=\"members.php\">Member List</a><br />- <a href=\"logout.php\">Logout</a></center>");if($user[rank]>=4) {if($user[rank]==5) {echo("<center>Hello, Admin<br />- <a href=\"postnews.php\">Post News</a></center>");}else{echo("<center>Hello, Moderator<br />- <a href=\"postnews.php\">Post News</a></center>");}}}?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/14523-nothing/#findComment-57544 Share on other sites More sharing options...
akitchin Posted July 13, 2006 Share Posted July 13, 2006 my post was suggesting using output buffering, of which one of the functions is ob_start(). have a look in the manual if you want to go that route. very few issues are solvable simply by adding one function, a little reading is always involved.to fix it, REMOVE OUTPUT BEFORE setcookie(). that was the simpler solution, and the solution first mentioned. move your <DOCTYPE> output to below where you process the login, and specifically, where you use setcookie(). this may require a restructure of your code (so that you manage to get the DOCTYPE out before you echo anything) such as putting any errors into a variable first and echoing it later, but you've gotta give a little to get anything. Quote Link to comment https://forums.phpfreaks.com/topic/14523-nothing/#findComment-57548 Share on other sites More sharing options...
BillyBoB Posted July 13, 2006 Author Share Posted July 13, 2006 i gots it it was in the index had to be fixed Quote Link to comment https://forums.phpfreaks.com/topic/14523-nothing/#findComment-57550 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.