OK, I have set up my main script, and am adding the content management part...but am having a problem

if $addpage=1 then it displays a form

the problem is, when you submit...it dosen't write to the db...nothing happens

if anyone could help, PLEASE DO!

Code:
  <?php 
if (isset($addpage)):
?> 
        <FORM ACTION="<?php echo($PHP_SELF); ?>" METHOD=POST>
          <P>Type the page text here<BR>
            <TEXTAREA NAME="pagetext" ROWS=20 COLS=50 WRAP></TEXTAREA>
            <BR>
            Please type in the page reference, this is the 'tag' on the end, i.e 
            misc.php?page=reference:<br>
            <input type="text" name="page">
            <br>
            Please type your name:<br>
            <input type="text" name="name">
            <br>
            <INPUT TYPE=SUBMIT NAME="submitpage" VALUE="SUBMIT">
        </FORM>
        <?php
else:

mysql_connect("localhost", "root", "noway");
mysql_select_db("misc");
mysql_query("INSERT INTO pages SET page='$page', Author='$name', DateAdded='20001020', pagetext='$pagetext'");


endif;

?>
Thanx for james helping me get this far

SITEPOINT RULES!

Alex