View Full Version : Needing some assistance!
lSFresh
16-02-2010, 09:37 AM
http://www.clubhabboforum.net/images/ranks/members.gif
Join Date » Nov 2009
Posts » 76
Rep Power » 0
http://www.clubhabboforum.net/images/reputation/reputation_neg.gif
http://www.clubhabboforum.net/images/icons/icon1.gif Needing some assistance!
I need help with one thing im sure one of you guys would know, probably how to fix this issue but im working on a User system atm and im getting an error like this
Warning: Cannot modify header information - headers already sent by (output started at myurlwebsite/index.php:7) in myurlwebsite/index.php on line 137
Warning: Cannot modify header information - headers already sent by (output started at myurlwebsite/index.php:7) in /myurlwebsite/index.php on line 138
Thank You! You will be redirected
on line 137 & 138 it shows this.
setcookie("id", $user[id],time()+(60*60*24*5), "/", "");
setcookie("pass", $user[password],time()+(60*60*24*5), "/", "");
i tried configuring some things around but this page is for users login they will be able to see the links but everytime i enter my user & pass it goes straight to that can anyone help?
Homosexual
16-02-2010, 04:46 PM
This generally means sessionstart or cookies aren't at the very top of the file and have already been set.
lSFresh
16-02-2010, 07:25 PM
So what will this mean this is the code i have in the index.php page
<style type="text/css">
/*this is what we want the div to look like
when it is not showing*/
div.loading-invisible{
/*make invisible*/
display:none;
}
/*this is what we want the div to look like
when it IS showing*/
div.loading-visible{
/*make visible*/
/*position it 200px down the screen*/
position:absolute;
top:0px;
left:0;
width:100%;
height:100%;
text-align:center;
/*in supporting browsers, make it
a little transparent*/
background:#fff;
opacity:.80;
border-top:1px solid #ddd;
border-bottom:1px solid #ddd;
}
</style>
</head>
<script language="JavaScript1.1" type="text/javascript">
<!--
var image1=new Image()
image1.src="images/welcome.png"
var image2=new Image()
image2.src="images/upload.png"
var image3=new Image()
image3.src="images/forum.png"
var image4=new Image()
image4.src="images/jobs.png"
var image5=new Image()
image5.src="images/contact.png"
var image6=new Image()
image6.src="images/firefox.png"
//-->
</script>
<body>
<div id="wrapper">
<div id="logo"></div>
<div id="top">
<div id="login">
<div id="login_top"></div>
<div id="side_mid_g">
<div align="left">
<?
oB_start();
// allows you to use cookies.
include("config.php");
if (!$logged[username])
{
if (!$_POST[login])
{
echo("
<a href=\"register.php\" target=\"mainframe\">Register</a> | <a href=\"lostpw.php\" target=\"myframe\">Lost Password</a>
<form method=\"POST\">
<table>
<tr>
<td>
<font size=\"1px\"> <b><font color=\"grey\">Username:</font></b></font><br />
<input type=\"text\" name=\"username\" class=\"text\" />
</td>
</tr>
<tr>
<td>
<font size=\"1px\"><b><font color=\"grey\">Password:</font></b></font><br />
<input type=\"password\" name=\"password\" class=\"text\" />
</td>
</tr>
<tr>
<td>
<input type=\"submit\" name=\"login\" class=\"button\">
</td>
</tr>
</table>
</form>");
}
if ($_POST[login]) {
// the form has been submitted. We continue...
$username = $_POST['username'];
$pass = md5($_POST[password]);
// the above lines set variables with the submitted information.
$info = mysql_query("SELECT * FROM users WHERE username = '$username'") or die(mysql_error());
$data = mysql_fetch_array($info);
if($data[password] != $pass) {
// the password was not the user's password!
echo "Incorrect username or password!";
}else{
// the password was right!
$query = mysql_query("SELECT * FROM users WHERE username = '$username'") or die(mysql_error());
$user = mysql_fetch_array($query);
// gets the user's information
setcookie("id", $user[id],time()+(60*60*24*5), "/", "");
setcookie("pass", $user[password],time()+(60*60*24*5), "/", "");
// the above lines set 2 cookies. 1 with the user's id and another with his/her password.
echo ("<meta http-equiv=\"Refresh\" content=\"2; URL=index.php\"/>Thank You! You will be redirected");
// modify the above line...add in your site url instead of yoursite.com
}
}
}
else
{
// we now display the user controls.
$new = mysql_query("select * from pmessages where unread = 'unread' and touser = '$logged[username]'");
$new = mysql_num_rows($new);
echo ("<center>Welcome <b>$logged[username]</b><br /></center>
- <a href=\"editprofile.php\">Edit Profile</a><br />
- <a href=\"messages.php\">Private Messages ($new New)</a><br />
- <a href=\"members.php\">Member List</a><br />
- <a href=\"logout.php\">Logout</a>");
}
?>
</div>
</div>
<div id="side_bot_g"></div></form>
</div></div>
Homosexual
16-02-2010, 09:58 PM
More than likely, this:
setcookie("id", $user[id],time()+(60*60*24*5), "/", "");
setcookie("pass", $user[password],time()+(60*60*24*5), "/", "");
Needs to be at the top of the file? :)
lSFresh
17-02-2010, 01:12 AM
so all the way at the top of the file? wont it need a session start type thing
lSFresh
17-02-2010, 01:34 AM
Sorry for Double Posting!
Its not working Homosexuality uhm can you help me out if not then its cool if you have msn can you PM me and we can talk more i just need help with just this one error.
Homosexual
17-02-2010, 11:41 AM
It does need a sessionstart type thing, try adding that too.
Want to hide these adverts? Register an account for free!
Powered by vBulletin® Version 4.2.5 Copyright © 2026 vBulletin Solutions Inc. All rights reserved.