提交后保留浏览器文件 - PHP

<?
$img="";
$comment="";
if(isset($_POST['save']))   
{
    $e="0";
    $comment=trim($_POST['comment']);
    if($comment=="")
    {
       $sel5="<--Enter Ur Opinon";
       $e="5";
       $code5="";
    }
    if($_FILES['photo']['name']=="")
    {
       $sel6="<--Select Your Photo";
       $e="6";
       $code6="";
    }
    else
    {
       $rand=rand().time();
       $photo_name=$_FILES['photo']['name'];
       $photo_tmp_name=$_FILES['photo']['tmp_name'];
       $photo_name1=explode(".",$photo_name);
       list($width,$height) = getimagesize($photo_tmp_name);
       if($photo_name1[1]=="jpeg"||$photo_name1[1]=="jpg"||$photo_name1[1]=="gif")
       {
         if($width<=365)
         {
            $img="1";
            $photo_name1=$photo_name[0].$rand.".".$photo_name[1];
            move_uploaded_file($photo_tmp_name,"Images/{$photo_name1}");
         }
         else
         {  
            $sz1="";
            $e="7";
            $sz_err="Not Perfect Size";
            $code6="";  
         }
     }
     else
     {
        $sz2="";
        $e="8";
        $sz_err="Not correct Type";
        $code6="";
     }  
     }
     if($e==0)
     {
        $suc="Success";
        $comment="";
     }
     }
?>

<html>
<body>
<style type="text/css" >
.message{color: red; font-weight:bold; }
.error{border:1px solid red; }
        </style>
            <table>
            <tr>
            <td>Verdict Of Sport</td>
            <td>
            <textarea name="comment" cols="40" rows="6" <? if(isset($code5))
            {echo "class=error" ;} ?>> <? echo $comment; ?>
            </textarea>
            </td>
            <td><? if(isset($sel5)){ echo "<p class='message'>".$sel5."</p>"; }?>
            </td>
            </tr>
            <tr>
            <td>Your Picture</td>
            <td <?php if(isset($code6)) {echo "class=error" ;} ?>>
            <input type="file" name="photo" value="<? if($img==="1") { echo $photo_name; } ?>"/>
            </td>
            <td>
            <? if(isset($sel6)){ echo "<p class='message'>".$sel6."</p>"; }?>
            <? if(isset($sz1)){ echo "<p class='message'>".$sz_err."</p>";}?>
            <? if(isset($sz2)){ echo "<p class='message'>".$sz_err."</p>";}?>
            </td>
    </tr>
    <tr>
    <td colspan="3" align="center">
    <input type="submit" name="save" /><?=$suc;?>
    </td>
    </tr>
            </table>
            </body>
            </html>

This program working correctly. When I enter Verdict of Sport and then click save, it shows Select Your Photo and what I have entered/typed showing in Verdict of Sport.
But without entering Verdict of Sport, then I select Photo-->click 'save', it shows 'Enter Ur Opinon'. And what I have selected photo is disappear.

So i need solution for browsed file should not be disappear when i 'save'.

There is a simpler way to deal with image uploads. Try wideimage.sourceforge.net/‎

That being said, what exactly are you trying to do? You want to upload the image and show it right?. For that you have to have an block with src set as the path of the file.

You can use an AJAX submit for your 'save' function. This will allow you to send your request and get your response without a page refresh. JQuery is a great javascript library that has great AJAX integration.