Jump to content

[SOLVED] loading my guestbook in my page


KFredje

Recommended Posts

Hi,

 

I want to load my guestbook in my page but there is something I can't fix myself.

 

If you look on this page: http://www.ludo.creative-j.org/V4/BEindex.php?pagina=gastenboek you see an error:

 

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/ludo/domains/ludo.creative-j.org/public_html/V4/BEindex.php:14) in /home/ludo/domains/ludo.creative-j.org/public_html/V4/guestbook/header.php on line 2

 

I know it's cause <html> is already started at BEindex.php :

 

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

<HTML>

<HEAD>
<TITLE>Windmolentechnologie</TITLE>
<LINK HREF="css/BEnav.css" REL="stylesheet" TYPE="text/css" />
<LINK HREF="css/BEcontent.css" REL="stylesheet" TYPE="text/css" />
<!--[if lte IE 7]>
<LINK HREF="css/ie7.css" REL="stylesheet" TYPE="text/css" />
<![endif]-->

<script type="text/javascript" src="js/klok.js"></script>

<?php
   switch($_GET['pagina']) {
            case "inhoud": $page="BEinhoud.html";break;
		case "logboek": $page="BElogboek.html";break;
            case "profielen": $page="BEprofielen.html";break;
		case "kalender": $page="BEkalender.html";break;
            case "gastenboek": $page="guestbook/guestbook.php";break;
            default: $page="BEhome.html";break;
   }
?>
<?php 
$myvar=file_get_contents("text.txt");
$myvar2=explode("\n",$myvar);
?>
</HEAD>

<BODY>

<div id="container">
<div id="NavTop"><a href="BEindex.php"><img class="be" src="images/be.gif"></a><a href="FRindex.php"><img class="fr" src="images/fr.gif"></a><a href="ENindex.php"><img class="en" src="images/en.gif"></a></div>
<div id="NavTitle"></div>
<div id="NavHome"><a href="?pagina=home"><img src="images/transparent.gif" class="transparent"></a></div>
<div id="NavInhoud"><a href="?pagina=inhoud"><img src="images/transparent.gif" class="transparent"></a></div>
<div id="NavLogboek"><a href="?pagina=logboek"><img src="images/transparent.gif" class="transparent"></a></div>
<div id="NavProfielen"><a href="?pagina=profielen"><img src="images/transparent.gif" class="transparent"></a></div>
<div id="NavKalender"><a href="?pagina=kalender"><img src="images/transparent.gif" class="transparent"></a></div>
<div id="NavGastenboek"><a href="?pagina=gastenboek"><img src="images/transparent.gif" class="transparent"></a></div>
<div id="NavBlank"></div>
<div id="NavBanner"></div>

<div id="midden">

<div id="ContentLeft">
<table id="klok"><tr>
<td id="kloktd">
<img src="dg8.gif" name="hr1"><img src="dg8.gif" name="hr2"><img src="dgc.gif" name="c"><img src="dg8.gif" name="mn1"><img src="dg8.gif" name="mn2"><img src="dgc.gif" name="c"><img src="dg8.gif" name="se1"><img src="dg8.gif" name="se2">
</td></tr></table>
<div id="nieuws"><?php echo $myvar2[4]; ?></div>
</div>

<div id="ContentRight">
<?php include $page; ?>
</div>

<div id="Footer"></div>
</div>
</div>

</BODY>

</HTML>

 

and this is header.php of my guestbook which make the error:

 

<?php
session_start();
?>

<!-- NOTE: PLEASE DO NOT REMOVE THE BELLOW 3 LINES FROM YOUR HEADER FILE -->
<?php
include("gbclass.php");
include("config.php");
include("language/$default_language");
?>
<!-- NOTE: PLEASE DO NOT REMOVE THE ABOVE 3 LINES FROM YOUR HEADER FILE -->

<html>
<head>
  <title>Powered by DigiOz Guestbook Version 1.7.2</title>
  <link rel="STYLESHEET" type="text/css" href="style.css">
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#8080ff" vlink="#0000ff" alink="#ffff00"><center>
<h1><?php echo $headingtitletxt ?></h1>


<br><br>
<center>
[ <a href="guestbook.php"><b><?php echo $addentrytxt ?></b></a> ]
[ <a href="list.php?page=1&order=asc"><b><?php echo $viewguestbooktxt ?></b></a> ]<br>
[ <a href="list.php?page=1&order=asc"><?php echo $newpostfirsttxt ?></a> ]
[ <a href="list.php?page=1&order=desc"><?php echo $newpostlasttxt ?></a> ]</center>
<br>
<form action="search.php" method=post>
<table border=0 cellpadding=2>
<tr>
<td><font size="1">Enter Search <b>WORD</b>:</font></td>
        <td align=left><input type="text" name="search_term" size=20 maxlength=50><input type=submit value="Find Now!"></td>
</tr>
</table>
</form>
<br>

 

How can i let the header work?

Link to comment
Share on other sites

weight space, or html before session_start()

<?php session_start();
  ?> // <<<no space example.

 

<?php 


session_start  ?> // <<< with space example

 

Because your adding a comment plug in ((but not advised using ob_start() but can do here?

 

never relay on ob_start() as session fix.

<?php ob_start(); session_start();

//code
ob_flush();
?>

Link to comment
Share on other sites

You couldn't understand that my god, don't change nonthinking add and see.

 

<?php ob_start(); session_start();
?>

<!-- NOTE: PLEASE DO NOT REMOVE THE BELLOW 3 LINES FROM YOUR HEADER FILE -->
<?php
include("gbclass.php");
include("config.php");
include("language/$default_language");
?>
<!-- NOTE: PLEASE DO NOT REMOVE THE ABOVE 3 LINES FROM YOUR HEADER FILE -->

<html>
<head>
  <title>Powered by DigiOz Guestbook Version 1.7.2</title>
  <link rel="STYLESHEET" type="text/css" href="style.css">
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#8080ff" vlink="#0000ff" alink="#ffff00"><center>
<h1><?php echo $headingtitletxt ?></h1>


<br><br>
<center>
[ <a href="guestbook.php"><b><?php echo $addentrytxt ?></b></a> ]
[ <a href="list.php?page=1&order=asc"><b><?php echo $viewguestbooktxt ?></b></a> ]<br>
[ <a href="list.php?page=1&order=asc"><?php echo $newpostfirsttxt ?></a> ]
[ <a href="list.php?page=1&order=desc"><?php echo $newpostlasttxt ?></a> ]</center>
<br>
<form action="search.php" method=post>
<table border=0 cellpadding=2>
<tr>



<td><font size="1">Enter Search <b>WORD</b>:</font></td>
        <td align=left><input type="text" name="search_term" size=20 maxlength=50><input type=submit value="Find Now!"></td>
</tr>
</table>
</form>
<br>
<?php ob_flush(); ?>

Link to comment
Share on other sites

session_start() must go on all pages  mikesta707...

 

what ur saying is why ppl get errors because they must not use session_start (dynamically with includes.

 

every page needs session_start() at the top ((written not added via a included file....

 

reference response to

all you really needed to do was put session_start at the beginning of your index page. whatever pages are included with a page that has session_start() on the top doesn't need to have session start

 

Link to comment
Share on other sites

i know, srry

 

but seems to be fixed in IE by adding this:

 

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

 

one prob now, can't check anymore in IE7 now since I installed IE8 :P

 

You can use this website to see how your website looks in various versions of IE.

Link to comment
Share on other sites

just added a comment on your messages, but there nothing stopping me adding loads of comments, also there nothing stopping me add spam to this message script, also there nothing cheeking the mx record of the email is correct.

 

improve your code or get thousands of spam every day.

 

ContentiFrame <<< what ever this is pointing at the css is wrong i thort it was a iframe sorry.....

Link to comment
Share on other sites

i know, srry

 

but seems to be fixed in IE by adding this:

 

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

 

tnx :)

 

fixed IE7 guestbook ^^

 

one prob now, can't check anymore in IE7 now since I installed IE8 :P

 

You can use this website to see how your website looks in various versions of IE.

 

@redarrow: I'm working on antispam

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.