Having probles uploading a picture to a folder
<p>I initialize the variables, use move_uploaded_file function and then I write a basic form user will use to upload their photo. I am trying to print at lease an error_msg or a sucess_msg showing wether they had sucess in loading the file or not. nothings is showwing up. Help! </p>

<pre><code>           $error_msg = "";
           $success_msg = "";
           $name2 = "";


       if ($_POST['parse_var'] == "pic"){

        if (!$_FILES['fileField']['tmp_name']) { 

            $error_msg = '&lt;font color="#FF0000"&gt;ERROR: Please browse for an image before you press submit.&lt;/font&gt;';

        } else {

            $maxfilesize = 51200; // 51200 bytes equals 50kb
            if($_FILES['fileField']['size'] &gt; $maxfilesize ) { 

                        $error_msg = '&lt;font color="#FF0000"&gt;ERROR: Your image was too large, please try again.&lt;/font&gt;';
                        unlink($_FILES['fileField']['tmp_name']); 

            } else if (!preg_match("/\.(gif|jpg|png)$/i", $_FILES['fileField']['name'] ) ) {

                        $error_msg = '&lt;font color="#FF0000"&gt;ERROR: Your image was not one of the accepted formats, please try again.&lt;/font&gt;';
                        unlink($_FILES['fileField']['tmp_name']); 

            } else { 

                        $newname = $id'.jpg';
                        $place_file = move_uploaded_file( $_FILES['fileField']['tmp_name'], "images/$id/".$newname);
                        $success_msg = '&lt;font color="#009900"&gt;Your image has been updated, it may take a few minutes for the changes to show... please                                                    be patient.&lt;/font&gt;';
            }

        } // close else that checks file exists

}


    &lt;table width="709" align="center" cellpadding="5"&gt;
            &lt;form action="edit_profile.php" enctype="multipart/form-data" method="post" name="pic1_form" id="pic1_form"&gt;
          &lt;!--    &lt;tr&gt;
                &lt;td width="125" class="style7"&gt;&lt;div align="center"&gt;&lt;strong&gt;Please Do First &amp;rarr;&lt;/strong&gt;&lt;/div&gt;&lt;/td&gt;

              &lt;/tr&gt;--&gt;
              &lt;tr&gt;
            &lt;td width="16%"&gt;&lt;?php print "$user_pic"; ?&gt;&lt;/td&gt;
            &lt;td width="74%"&gt;
              &lt;input name="fileField" type="file" class="formFields" id="fileField" size="42" /&gt;
              50 kb max
           &lt;/td&gt;
            &lt;td width="10%"&gt;
              &lt;input name="parse_var" type="hidden" value="pic" /&gt;
              &lt;input  type="submit" name="button" id="button" value="Submit" /&gt;
            &lt;/td&gt;
           &lt;/tr&gt;
           &lt;/form&gt;&lt;/table&gt;
</code></pre>
