im trying to creat an email form with php here is wat I have and it isnt working

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<title>Jacob Sherman</title>
<link rel="stylesheet" href="content.css" type="text/css" />
<form action="" method="post" enctype="text/plain">
    <table border="0" cellspacing="0" cellpadding="4" width="90%">
            <td width="30%"><div align="right"><b>Name:</b></div></td>
            <td width="70%"><input type="text" name="name" size="20" /></td>

            <td><div align="right"><b>Email:</b></div></td>
            <td><input type="text" name="email" size="20" /></td>

            <td><div align="right"><b>Subject:</b></div></td>
            <td><input type="text" name="subject" /></td>

            <td><div align="right"><b>Comment:</b></div></td>
            <td><textarea name="comment" cols="30" rows="4"></textarea></td>

                <input type="submit" name="submit" value="Submit" />
                <input type="reset" name="reset" value="Reset" />
        //retrieve all the information from the form
        $name = $_POST['name'];
        $email = $_POST['email'];
        $subject = $_POST['subject'];
        $comment = $_POST['comment'];
        //check to see if the data has been entered correctly
        if($name != "" && $email != "" && $subject != "" && $comment != ""){
            $email_pieces = explode("@", $email);
            $num_of_peices = sizeof($email_pieces);
            if($num_of_pieces != 2){
                echo "Please enter a correct email address and resubmit, thank you. </br>";
                $filename = $subject . ".txt"; //should put together <subject>.txt
                $filelocation = "/localhost/" . $filename;//sets the filelocation
                $fp = fopen($filelocation, "w");//file location with the name of the file, which will be created if it isn't there
                //write all the data to a text file
                fwrite($fp, $name . "\n");
                fwrite($fp, $email . "\n");
                fwrite($fp, $subject . "\n");
                fwrite($fp, $comment);
                fclose($fp);//closes the file and saves
                echo "Your message has been successfully sent: " . $_POST['name'] . "!</br>";
            echo "Missing information, please enter all the information and re-submit, thanks </br>";

Help us out a bit - what isn't working? Are you getting error messages?

oh I found out the problem wasnt with the code but most likely with my php and apache set up. I just need to configure it right and it should work