Undefined index??

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jiehuang001
Forum Commoner
Posts: 39
Joined: Mon May 12, 2003 12:53 pm

Undefined index??

Post by jiehuang001 »

I used the following two files trying to do a file uploading. While I just tried to output the file name, I got this error "Notice: Undefined index: file_name".

Please let me know what wrong I made.


-------------------UploadNew.php---------------------
<form action="upload.php" method="post" enctype="multipart/form-data">
<p>Upload file: <input type="file" name="file_name"></p>
<P><input type="submit" value="Upload"></p>
</form>

---------------upload.php-------------------
<?php
$conn = OCILogon("scott", "tiger", "DbName");
$filename = $_POST['file_name'];
print $filename;
?>
User avatar
Wayne
Forum Contributor
Posts: 339
Joined: Wed Jun 05, 2002 10:59 am

Post by Wayne »

Code: Select all

$filename = $HTTP_POST_FILES&#1111;'file_name']&#1111;'name'];
you might want to read the manual about file uploads to get the rest of the functionality.
Post Reply