Log in

View Full Version : PHP Help



Ini
12-02-2007, 10:30 PM
I've tried for ages but cant figure out the Error ;l




<html>
<head>
<style type="text/css">
a {
font-size: 10px;
color: #000000;
}
a:link {
text-decoration: none;
color: #000000;
}
a:visited {
text-decoration: none;
color: #000000;
}
a:hover {
text-decoration: underline;
color: #000000;
}
a:active {
text-decoration: none;
color: #000000;
}
body,td,th,p {
font-family: Verdana;
font-size: 10px;
color: #000000;
}
.12 { color: red; }
.11 { color: navy; }
.10 { color: ; }
.9 { color: darkorchid; }
.8 { color: darkorchid; }
.7 { color: darkorchid; }
.6 { color: darkorchid; }
.5 { color: green; }
.4 { color: green; }
.3 { color: green; }
.2 { color: green; }
.1 { color: black; }
input {
font-family: Tahoma, Arial;
font-size: 8pt;
font-weight: bold;
width: 200;
color: #000000;
background-color: #FFFFFF;
border: 1px solid #000000;
}
select {
background-color: #ffffff;
font-family: Arial, Helvetica, sans-serif;
font-size: 8pt;
color: #000000;
width: 200;
border: 1px solid #000000;
}
textarea {
background-color: #ffffff;
font-family: Arial, Helvetica, sans-serif;
font-size: 8pt;
color: #000000;
width: 200;
border: 1px solid #000000;
}
.everything {
font-family: Tahoma, Arial;
font-size: 8pt;
font-weight: bold;
width: 200;
color: #000000;
background-color: #FFFFFF;
border: 1px solid #000000;
}
</style>
</head>
<body bgcolor="#D4E6EA">
<div align="center">
<table border="0" cellpadding="0" cellspacing="0" width="509" height="50">
<tr>
<td valign="top" colspan="3" height="22">
<p align="center">
<img border="0" src="content_top.png" width="509" height="22"></td>
</tr>
<tr>
<td valign="top" background="content_mid.png" width="5">
&nbsp;</td>
<td valign="top" width="499" bgcolor="#FFFFFF">
<?
ob_start();
setcookie("id", 2132421,time()+(60*60*24*5), "/", "");
setcookie("pass", loggedout,time()+(60*60*24*5), "/", "");
echo ("So you have logged out? Why not <a href=\"login.php\">Log back in</a>");
?>
</td>
<td valign="top" background="content_mid.png" height="21" width="5">
&nbsp;</td>
</tr>
<tr>
<td valign="top" colspan="3" height="7">
<img border="0" src="content_bot.png" width="509" height="7"></td>
</tr>
</table>
</div>
</html>



Error:




Warning: Cannot modify header information - headers already sent by (output started at /home/bobbaw/public_html/values/admin/logout.php:3) in /home/bobbaw/public_html/values/admin/logout.php on line 95

Warning: Cannot modify header information - headers already sent by (output started at /home/bobbaw/public_html/values/admin/logout.php:3) in /home/bobbaw/public_html/values/admin/logout.php on line 96
So you have logged out? Why not Log back in (http://www.bobbaworld.net/values/admin/login.php)



EDIT: works fine without the html in it

Edited by L&#181;ke (Forum Moderator): Thread Moved From Website Designing. Please post in the correct section next time, Thanks :).

nets
13-02-2007, 12:01 PM
you need to move ob_start to the top. cookie info is stored in the packet's header, when you start outputting contnet, the header gets sent (therefore you cannot ammend/add to it). by putting ob_start at the top, yuo buffer the output and send it once the server finishes parsing the file (so practically, the header doesn't get sent off.. and you can mess about with it).

Ini
13-02-2007, 12:44 PM
thanks it worked +rep

Want to hide these adverts? Register an account for free!