<html>
<body>
<form method="POST" enctype="multipart/form-data" action="<?=$_SERVER['PHP_SELF']?>">
<p align="center">
<input type="file" name="FileName" size="26" style="font-family: Tahoma; font-size: 10pt" dir="ltr"></p>
<p align="center">
<input type="submit" value="ارسال..." name="submit_upload" style="font-family: Tahoma; font-size: 10pt" dir="rtl">
</p>
</form>
</body>
</html>
<?
$FileName = $_FILES['FileName']['tmp_name'];
if ($FileName) {
$TheFile = "temp.txt";
copy ($FileName, $TheFile)
?>
<center>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#808080" width="21%" id="AutoNumber1" dir="rtl" bgcolor="#F9F9FF">
<?
$Open = @fopen ($TheFile, "r");
if ($Open) {
$Data = file ($TheFile);
for ($n = 0; $n < count($Data); $n++) {
?>
<tr>
<td width="100%" align="center">
<p align="center"><?=trim($Data[$n])?>
<?PHP
// Query for write in database...
?>
</td>
</tr>
<?
}
@fclose ($Open);
} else {
?>
<tr>
<td width="100%" align="center">
<p align="center" dir="ltr">Unable to read from '<?=$TheFile?>' !</td>
</tr>
<?
}
?>
</table>
</center>
<?
}
?>