Hmm, having a session problem here....
Here are my new source codes...
index.php
<html>
<head>
<?
echo "<title>MySite.";
if(!session_id()){
session_start();
}
if (isset($_GET['lang'])) {
//if lang is set do stuff
if ($_GET['lang'] == "be") {
echo "be";
$_SESSION['lang'] = 'be';
} elseif ( $_GET['lang'] == "nl") {
echo "nl";
$_SESSION['lang'] = 'nl';
}
}
else
{
echo "nl";
$_SESSION['lang'] = 'nl';
}
echo "</title>";
?>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<frameset rows="101,*" cols="*" frameborder="NO" border="0" framespacing="0">
<frame src="top.php" name="topFrame" scrolling="NO" noresize>
<frameset rows="*" cols="143,*" framespacing="0" frameborder="NO" border="0">
<frame src="nav.php" name="leftFrame" scrolling="NO" noresize>
<frame src="welkom.php" name="mainFrame">
</frameset>
</frameset>
<noframes><body>
</body></noframes>
</html>
top.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
background-image: url(images/top_bg.jpg);
margin-top: 0px;
margin-left: 0px;
}
.style1 {
font-family: Verdana, Arial, Helvetica, sans-serif;
color: #999999;
}
-->
</style></head>
<body>
<h1 align="left"><img src="images/topleft.jpg" width="102" height="100" align="left"><em><br>
<span class="style1"> <? echo "MySite.";
echo $_SESSION['lang']; ?>
</span></em></h1>
</body>
</html>
welkom.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style1 {font-family: Verdana, Arial, Helvetica, sans-serif}
.style2 { font-family: Verdana, Arial, Helvetica, sans-serif;
color: #999999;
}
-->
</style></head>
<body>
<h3><span class="style1">Welcome</span></h3>
<p><span class="style1">this is
<em><span class="style2"><? echo "MySite.";
echo $_SESSION['lang']; ?></span></em>, some more blah blah here.</span></p>
</body>
</html>
I get these errors.
index.php
<title>MySite.<br />
<b>Warning</b>: session_start(): Cannot send session cookie - headers already sent by (output started at c:\inetpub\wwwroot\MySite\index.php:3) in <b>c:\inetpub\wwwroot\MySite\index.php</b> on line <b>6</b><br />
<br />
<b>Warning</b>: session_start(): Cannot send session cache limiter - headers already sent (output started at c:\inetpub\wwwroot\MySite\index.php:3) in <b>c:\inetpub\wwwroot\MySite\index.php</b> on line <b>6</b><br />
nl</title>
top.php
MySite.
Notice: Undefined variable: _SESSION in c:\inetpub\wwwroot\MySite\top.php on line 23
welkom.php
Welcoe
this is MySite.
Notice: Undefined variable: _SESSION in c:\inetpub\wwwroot\MySite\welkom.php on line 19
, some more blah blah here.
Doesn't look very good 😕