I open this dbx file (the file names has extention dbx)
Send Item.dbx
Outpput.dbx etc.
as mentioned by you.
I am reading character by character and looking for space , tab and coma as deliminater still what I am reading is some junk whch does not make sense.
Please help
comple code is given below (asks for inout and seperatwes e-mail addreses from the file (delimited by comma, space and tax and cCRLF
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
if (isset($submit))
{
print"Submit action ********";
print "file name =$fn<br> **********<br>";
$fp = fopen ($fn , "r");
$size= filesize($fn);
print "file size= $size <br>";
while (!feof ($fp)) {
$buff = fgetc($fp);
$asci = chr($buff);
$bx = $bin2hex($buff);
print "Bin2Hex : $bx $buf";
print "asci = $asci $buff <br>;";
if ($buff=="\t" or ($buff=="\n") or ($buff==" ") or ($buff==","))
{
// print "There is tab / crlf or space here<br>";
print "<br>String formed **$mystring<br>";
$gid=0;
$cid=0;
$pos= strpos($mystring,'@') ;
print "<br> $pos [$mystring] <br>";
if ($pos==false)
{
print "invalid e-mail id ..record skipped <<$email>>";
}
else
{
$insertquery="insert into emailregister values ($cid,'$mystring',$gid,'$sdt','$stime')";
print "<br>$insertquery)";
$resultinsert=mysql_db_query("fafai",$insertquery);
if ($resultinsert= true)
{
print "Query Succeeded";
}
else
{
print "Query Failed";
}
}
$mystring="";
}
$mystring.=$buff;
}
fclose ($fp);
}
?>
<table width="779" border="1" cellspacing="1" cellpadding="2">
<form action="<?php $PHP_SELF ?>" method="post">
<tr>
<td width="65" height="32" valign="top">File Name *</td>
<td width="215" valign="top"><input type="text" name="fn" height="9" width="25"></td>
<td width="397" valign="top"><input name="submit" type="submit" value="Upload this file"></td>
</form>
<tr>
<td height="68"> </td>
<td> </td>
<td> </td>
</tr>
</table>
</body>
</html>
</body>
</html>