that didn't work.
here's the whole script:
<?
@include("admin_menu2.php");
@require_once("sc_fns.php");
@admin_header();
?>
</TABLE>
<TABLE WIDTH=760 COLS=1 BORDER=0 CELLPADDING=0 CELLSPACING=0>
<TR>
<TD WIDTH=760 BGCOLOR=333366 HEIGHT=20><FONT FACE='ARIAL, HELVETICA' SIZE='1' COLOR='FFFFFF'><B> Import Miva Products<B></TD>
</TR>
</TABLE>
<form action="<?$PHP_SELF?>" method=post>
<input type="file" name="data">
<input type="submit" name="import" value="Import">
</form>
<?
if($import)
{
//$data = str_replace("\\\\", "\\", $data);
//using this part just to open the file
echo $data."<br>";
include("dbconnect.php");
$filename = "C:/Documents and Settings/Owner/Desktop/mivaproducts421.dat";
$fp = fopen($filename, "r");
$contents = fread($fp, filesize($filename));
echo $contents;
fclose($fp);
//using previous part to open the file
for($i=0; $i<count($file); $i++)
{
$contents = str_replace(",", " ", $file[$i]);
$contents = str_replace("\t", ",", $contents);
$contents = explode(",", $contents);
$id = $contents[0];
$prod_name = $contents[1];
$price = $contents[3];
$weight = $contents[5];
$prod_sum = $contents[6];
$prod_desc = $contents[6];
if($contents[7] == 1){$tax = "N";}else{$tax = "Yes";}
$sm_image = $contents[8];
$lg_image = $contents[9];
$query = "insert into products values('', '$id', '$prod_name', '', '$price', '', '$tax', '0', 'N', '0', '1', '$weight', 'N', 'N', '$lg_image', '100', '$sm_image', '', '', '$prod_desc', 'none', 'General', 'General', '$item_sum', 'ea', '')";
$result = mysql_query($query, $mysql_link);
echo $contents[1]."<br>";
}
/*$file = fopen($data, r);
$contents = fread($file, filesize ($data));
echo $contents;
fclose($file);*/
}
?>