EDIT- Just need to find out why variables aren't being written in the fwrite function. my $pageIdentity isn't being written (it being a variable). That whole word is being ommited

Hello. I'm currently making a blog and long story short, I'm almost done. I've decided that upon me submitting the blog form, it will tkae the information, store it in the database, and then it will create the page (and thus from there it will have the article written)

I'm wondering if there's a way to make THIS code
<?php $pageIdentity="Blog".;
<div id="wrapper">
    <?php include("../../header.php");?>
    <div id="main">
        <?php include("../../menu.php");?>
        <div id="page">
                <div id="content">
                    <div class="post">                            
                        <h2 class="title"><a href="#">Blog Homepage</a></h2>
                        <p class="meta">Posted  on  &nbsp;&bull;&nbsp; <a href="#" class="permalink">Full article</a></p>
                        <div class="entry">
                            <p><img src="../images/img04.jpg" width="186" height="186" alt="" class="alignleft border" />Article Content goes here.</p>
<?php include ("../../sidebar.php");?>
    <?php include("../../footer.php");?>
Be the default code that's written in the file (the fopen() function will create the page and I want that to be defaulted)

Here is what I have for my submission page
$insertionToDatabase="INSERT INTO $tableName (PostNumber, DateTime, Content, type, URL) VALUES (NULL, FROM_UNIXTIME($dateTime), '$contentOfPost', '$type', '$URL')";

$result = mysql_query($insertionToDatabase);
if (!$result) {
    die('Invalid query: ' . mysql_error());
$fh = fopen($URL, 'w') or die("can't open file");
$stringData = "";
fwrite($fh, $stringData);

I have more than that but you shouldn't need to see any more. Basically if the results get entered into the database, write the file. $stringData I want to contain the first code segment I posted above.