mysteryminds
IS-IT--Management
fopen() is kewl but I'm trying to figure out how could we possibly make the output in the text file assign the specified columns.
<?
include ("include/header.inc.php");
if($_POST)
$fp = fopen("newfile.txt", "a") or die("Couldn't create new file");
{
for($i=0;$i < $_POST['rn'];$i++)
{
$numBytes = fwrite($fp, "$surname[$i] $forename[$i], $add1[$i], $area[$i]. \n");
}
}
fclose($fp);
?>
( Well assuming that we have 3 fields to output e.g Name, address1 and town)
the output should be something like
peter sameul<--space--->1st street<--space--->town1---->
PHP King<------space--->2nd street<--space--->town2---->
<?
include ("include/header.inc.php");
if($_POST)
$fp = fopen("newfile.txt", "a") or die("Couldn't create new file");
{
for($i=0;$i < $_POST['rn'];$i++)
{
$numBytes = fwrite($fp, "$surname[$i] $forename[$i], $add1[$i], $area[$i]. \n");
}
}
fclose($fp);
?>
( Well assuming that we have 3 fields to output e.g Name, address1 and town)
the output should be something like
peter sameul<--space--->1st street<--space--->town1---->
PHP King<------space--->2nd street<--space--->town2---->