0
<!DOCTYPE html>
<html>
<head>
    <title>Registration Form</title>
    <link rel="stylesheet" media="screen" href="style.css" >
</head>
<body>
<div class="head" style="background:#343434;width:auto;height:100px">
<br/>
 <h2 Style="color:white"><center>NAVAL DOCKYARD, VISAKHAPATNAM-530 014 </br> APPLICATION FOR ABSORPTION OF TRADESMAN(SKILLED)</center> </h2>
</div>
 <form enctype="multipart/form-data" class="contact_form"  action=
"<?php echo $_SERVER['PHP_SELF']; ?>" method="post">

  <ul>
        <h4>Registration Form </h4> 
<hr/>
    <li>
        <label for="name">APPLICANT PHOTO :<sup style="color: red;">*</sup></label>
           <input type="hidden" name="MAX_FILE_SIZE" value="10000000" />
        <input name="userfile" type="file" />
    </li>
<li>
        <button class="submit" type="submit">Submit Form</button>
    </li>
  </ul>
  </form>
</body>
</html>
<?php

// check if a file was submitted

if ($_SERVER['REQUEST_METHOD'] == 'POST') 
{

    if(!isset($_FILES['userfile']))
    {
        echo '<p>Please select a file</p>';
    }
    else
    {
    echo "Varma";
    header("Content-type: image/jpeg");
    echo $_FILES['userfile'];
    }
}
?>

Quoted Text Here
i want to display the image which was posted in the form..please help me

2
Contributors
1
Reply
2
Views
4 Years
Discussion Span
Last Post by AARTI SHRIVAS
0
else
    {
    echo "Varma";
    header("Content-type: image/jpeg");
    echo $_FILES['userfile'][name];
    $image=$_FILES['userfile']['name']
    }
    ?>
    <html>
            <head>
                <title></title>
            </head>
            <body>
            <img src="<?php echo $image;?>">
            </body>
            </html>

may be you have to try this in your else condition

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.