i am using the get
method to upload the file and when i write the $_FILES["file"]["name"]
then it gives the error Undefined index: file
but if i use the post
method then it works fine. How can i access the file name or file type.Here is the code of first page.
<html>
<body>
<form action="upload2.php" method="GET"
enctype="multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="file" id="file"><br>
<input type="submit" name="submit" value="Submit">
</form>
</body>
</html>
Here is the code of second page
<?php
$_FILES["file"]["name"];
?>