I have two pages, both extremely simple. One of the has some code on it which is literally an iframe with some basic CMS controls which allows the user to enter some text in it (by default it reads some pre-written text from a file and pastes it into the iframe).
<?php
session_start();
if (isset($_SESSION['logged_in']) != true) {
header('Location: login.php?ermess=logout');
}
echo "<?xml version='1.0' encoding='UTF-8'?>";
$_SESSION['pagename'] = $_GET['pagename'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<link rel="stylesheet" type="text/css" href="cpanel.css" />
<head>
<title>Page editor</title>
<script type="Javascript" src="editor.js"></script>
</head>
<body>
<form method="POST" action="saver.php">
<div>
<input type="button" onclick="Colour('Green')" style="background-color:Green;" />
<input type="button" onclick="Colour('Red')" style="background-color:Red;" />
<input type="button" onclick="Colour('Blue')" style="background-color:Blue;" />
<input type="button" onclick="Colour('Black')" style="background-color:Black;" />
<input type="button" onclick="Format('bold')" value="B" />
<input type="button" onclick="Format('italic')" value="I" />
<input type="button" onclick="Format('Underline')" value="U" />
<input type="button" onclick="Format('justifycenter')" value="C" />
<input type="button" onclick="Format('justifyleft')" value="L" />
<input type="button" onclick="Format('justifyright')" value="R" /><br/>
<?php echo "<iframe id='textbox' name='textbox' style='width:300px; height:150px'; src='../site/{$_GET['pagename']}'></iframe><br/>"; ?>
<input type="submit" value="Save changes" />
<input type="hidden" id="text" name="text" />
</div>
</form>
</body>
</html>
Then the user clicks Save, and the text from an iframe gets POSTed to another page, which is suposed to echo it, but doesn't.
<?php session_start();
if (isset($_SESSION['logged_in']) != true) {
header('Location: login.php?ermess=logout');
}
echo "lol";
echo $_POST['text'];
echo $_POST['textbox'];
?>
So - iframe, submit button, echo.
I went over and over the code and can't see why the text doesn't get posted... Any help would be greatly appreciated!