When you use the HTML-FORM 'file-upload box' and send it to a php-handler, PHP provides a variable ($FILES) to store all the data that comes with, including the original file name.
Note that $FILES contains an array of file-data. Each item of $_FILES is in itself an array.
See http://www.phpbuilder.com/manual/features.file-upload.php for more details.
Here's a sample HTML form and corresponding handler to get you on the road ...
// Form page - formupload.html
<html>
<head>
<title>Testing PHP4 - Forms - form upload</title>
</head>
<body>
<h3>Testing PHP4 - Forms - form upload</h3>
<table border="0" cellpadding="3" cellspacing="0">
<form name="upload_form" action="formupload.php" method="post" enctype="multipart/form-data">
<tr><td><input type="file" name="userfile" size="30"></td></tr>
<tr><td><input type="submit" value="Upload new image"></td></tr>
</form>
</table>
</body>
</html>
//Form handler - formupload.php
print_r($_FILES);
Hope that helps.