Cannot pull data from FORM

Hi guys,

When i submit my form the text page is supposed to output the data that i inserted into the textarea box and the form box, does anyone know why below is my code:

newpost.php


<script src="nicEdit.js" type="text/javascript"></script>
<script type="text/javascript">bkLib.onDomLoaded(nicEditors.allTextAreas);</script>

<div id="sample">

<form name="form" action="function.php?method=posttopic" method="post">
<b>Topic Name:</b> <input type="text" name="topicname" maxlength="30"><input type="hidden" name="topicname"><br></br>

<textarea name="mtext" style="width: 100%; height: 75%;">Your message here...</textarea></div>

<br><input type="submit" name="newpost" value="Post Topic">
</form>

function.php


<?php
include "../config/database.php";
$method=$_GET['method'];
$messageid=$_GET['messageid'];
$topicname=$_POST['topicname'];
$mtext=$_POST['mtext'];

if ($method=="posttopic")
{
echo "topic name is $topicname and text is $mtext";
}
?>

sorry guys problem fixed.