Jump to content

Error on my server host.


unlishema.wolf

Recommended Posts

Ok I have a error on my server host but it don't show the error on my localhost.

 

<a href="./" onclick="<br />

<b>Warning</b>:  Cannot modify header information - headers already sent by (output started at /var/www/sites/unlishema.dyndns.org/www/styles/purple/header.php:7) in <b>/var/www/sites/unlishema.dyndns.org/www/index.php</b> on line <b>27</b><br />

">Purple Style test</a>

 

<a href="./" onclick="<?php setcookie('style','purple'); ?>">Purple Style test</a>

 

It works perfectly on my local server but when I put it onto my host server it gives me that error. I grabed the error from the html source btw. so I just left the code it was in for some help.

Link to comment
https://forums.phpfreaks.com/topic/207793-error-on-my-server-host/
Share on other sites

I have look around to find a different solution. I have tried all kinds of things. All I am try to do is set it so I can change styles on my website. I was wanting to use cookies but I can't figure out why it won't work on my host. It works all the ways I have tried on my local server.

i added ob_start(); and the error went away but it still won't set my cookie.

 

here is all my code and you see what i am wanting. it is really sloppy cause i just started back in php and was wanting to start with the part that is hard to integrate. i only including default style cause they both the same except colors. the other style i'm trying to get working is in a folder called purple though if you want to know.

 

here is also my website in case you need/want it. http://unlishema.dyndns.org

 


 

./index.php

<?php
ob_start();
if (isset($_GET["style"]))
{
setcookie("style",$_GET["style"]);
header( 'Location: ./' ) ;
}
if (isset($_COOKIE["style"]))
{
$style = $_COOKIE["style"];
}
else
{
$style = "default";
}

include "styles/$style/header.php";
?>

<table><tr><td width="875">

<div class="navigation">
<a href="./">Home</a>
</div>

<div class="content_left">
Under Construction.
</div>

<div class="content_right">
Style is being worked on. Try one of the following links.<br /><br />

<a href="./?style=default">Black Style</a><br />
<a href="./?style=purple">Purple Style</a><br />
<a href="./" onclick="<?php setcookie('style','purple'); ?>">Purple Style test</a>
</div>

</td></tr></table>

<?php include "styles/$style/footer.php"; ?>

 

./styles/default/header.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Unlishema Dev :: Home</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="Unlishema Dragonsworn's development page. Here I publish the development of my projects and set up beta testing for some of my projects." />
<meta name="keywords" content="unlishema unlishema.wolf dragonsworn dragonsworn's development dev project" />
<meta name="copyright" content="Unlsihema Dev" />
<meta name="author" content="Unlishema Dragonsworn" />

<meta name="email" content="unlishema.wolf@unlishema.co.cc" />
<meta name="Rating" content="General" />
<meta name="Robots" content="INDEX, FOLLOW" />
<meta name="Revisit-after" content="7 Days" />
<link rel="stylesheet" href="styles/default/style.css" />
</head>

<body>
<center>
<img src="styles/default/img/logo.jpg" /><br />

 

./styles/default/footer.php

<div class="copyright">
Website © Copyright 2010 - <a href="mailto:unlishema.wolf@hotmail.com" target="_new">Unlishema Dragonsworn</a> <br />
</div></center></body></html>

 

./styles/default/style.css

body
{
font-family: verdana;
font-size: 14px;
color: #D7D7D7;
background-color: #090909;
}
a
{
color: #FF0000;
text-decoration: none;
}
a:hover
{
text-decoration: underline;
}
.navigation
{
width: 850px;
padding: 5px 10px 5px 10px;
background-color: #0F0F0F;
border: solid 3px #000000;
color: #FF0000;
text-align: center;
}
.content_left
{
width: 410px;
float: left;
padding: 5px 10px 5px 10px;
background-color: #0F0F0F;
border: solid 3px #000000;
text-align: left;
}
.content_right
{
width: 410px;
float: right;
padding: 5px 10px 5px 10px;
background-color: #0F0F0F;
border: solid 3px #000000;
text-align: left;
}
.copyright
{
width: 850px;
float: bottom;
padding: 5px 10px 5px 10px;
background-color: #0F0F0F;
border: solid 3px #000000;
font-size: 10px;
color: #D7D7D7;
text-align: center;
}

I found my error and fixed it. It actually was because I had the second style set wrong. It was the same as the first. And found out why it was giving me an error. I was given an error cause I had a link to set a cookie onclick after i had already output.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.