error in php don't know what I am doing wrong
<p>I am getting this error
Warning: fopen() expects at least 2 parameters, 1 given in C:\wamp\www\fileFormProcess.php on line 19</p>

<p>Warning: feof(): supplied argument is not a valid stream resource in C:\wamp\www\fileFormProcess.php on line 29</p>

<p>Warning: fgets(): supplied argument is not a valid stream resource in C:\wamp\www\fileFormProcess.php on line 30</p>

<p>Warning: Wrong parameter count for explode() in C:\wamp\www\fileFormProcess.php on line 31</p>

<p>I been looking over the files and can not see what I am doing wrong.
here's my code:</p>

<pre><code>&lt;?php

if($_POST['firstName']==""|| $_POST['lastName']==""|| $_POST['address']==""||      $_POST['city']==""|| $_POST['state']==""|| $_POST['zip']==""){
header("Location:fileInsert.php?status=2");
 }
else{
$newRecord="\n";
$newRecord.=$_POST['lastName']."|".$_POST['firstName']."|".$_POST['address']."|".$_POST['city']."|".$_POST['state']."|".$_POST['zip'];

$myFile="records.txt";
$fp = fopen($myFile, "a");

//Write the data to the file
fwrite($fp, $newRecord);

//Close the file
fclose($fp);
if (file_exists($myFile)) {
$file = fopen($myFile.'r');
$rowcount=0;
echo "&lt;html&gt;\n";
echo " &lt;head&gt;\n";
echo " &lt;title&gt;Sucess!&lt;/title&gt;\n";
echo " &lt;link href=\"contact1.css\" type=\"text/css\" rel=\'stlesheet\"&gt;";
echo " &lt;/head&gt;\n";
echo " &lt;body&gt;";
echo " &lt;table width=\"75%\" cellpadding=\"2\" cellspacing=\"2\" border=\"1\"&gt;\n";
echo " &lt;tr&gt;\n";
while (!feof($file)) {
$line = fgets($file);
$aryData=explode("|",$line);
$firstname=$aryData[1];
$lastname=$aryData[0];
$address=$aryData[2];
$city=$aryData[3];
$state=$aryData[4];
$zip=$aryData[5];
echo "&lt;td align=\"center\"&gt;";
echo $firstname."".lastname;
echo "&lt;br&gt;".$address;
echo "&lt;br&gt;".$city.".".$state."".$zip;
echo "&lt;/td&gt;\n";
$rowcount++;
if ($rowcount!=0 &amp;&amp; $rowcount%3==0){
  echo " &lt;/tr&gt;\n";
  echo " &lt;tr&gt;\n";
    }

}
while($rowcount%3!=0){
 echo "&lt;td&gt;&amp;nbsp;&lt;/td&gt;\n";
 $rowcount++;
 }
 echo "&lt;/table&gt;\n";
 }
}
echo "&lt;/body&gt;\n";
echo " &lt;/html&gt;\n";
</code></pre>

<p>and</p>

<pre><code>&lt;?php
if ($_GET['status']==2){
    $strMessage="&lt;strong&gt;All fields are required!&lt;/strong&gt;";
 }
 elseif($_GET['status']==1){
     $strMessage="&lt;strong&gt;Your information has been added.&lt;/strong&gt;";
}
else{
$strMessage="";
}
 ?&gt;
 &lt;html&gt;
 &lt;head&gt;
 &lt;link href="contact1.css" type="text/css" rel="stylesheet"&gt;
 &lt;title&gt;Write to a file&lt;/title&gt;
 &lt;style type="text/css"&gt;
fieldset{
width:50%;

 }
&lt;/style&gt;

&lt;/head&gt;
&lt;body&gt;
&lt;?php echo $strMessage; ?&gt;
&lt;p&gt;
&lt;form name='myForm' method='post' action="fileFormProcess.php"&gt;
  &lt;fildset&gt;&lt;legand&gt;&lt;i&gt;All Fields are Required&lt;/i&gt;&lt;/legand&gt;

  &lt;table id='form'  border='0' cellpadding='6'&gt;
  &lt;tr&gt;
&lt;td&gt;First Name:&lt;/td&gt;
&lt;td&gt;&lt;input type='text' name='firstName'&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
&lt;td&gt;Last Name:&lt;/td&gt;
&lt;td&gt;
&lt;input type='text' name='lastName'&gt;&lt;/td&gt;
  &lt;/tr&gt;
   &lt;tr&gt;
&lt;td&gt;Street Address:&lt;/td&gt;
&lt;td&gt;&lt;input type='text' name='address'&gt;&lt;/td&gt;
   &lt;/tr&gt;
   &lt;tr&gt;
&lt;td&gt;City:&lt;/td&gt;
&lt;td&gt;&lt;input type='text' name='city'&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
&lt;td&gt;State:&lt;/td&gt;
&lt;td&gt;&lt;input type='text' name='state'&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
&lt;td&gt;Zip:&lt;/td&gt;
&lt;td&gt;&lt;input type='text' name='zip'&gt;&lt;/td&gt;
   &lt;/tr&gt;
   &lt;tr&gt;
&lt;td&gt;&lt;input type='reset' value='Reset Form' name='reset'&gt;&lt;/td&gt;
&lt;td&gt;&lt;input type='submit' value='Submit Form' name='submit'&gt;&lt;/td&gt;
&lt;/tr&gt;
  &lt;/table&gt;
  &lt;/fieldset&gt;
  &lt;/form&gt;
  &lt;/p&gt;
  &lt;/body&gt;
  &lt;/html&gt;
</code></pre>

<p>and this is the record.txt file that it is suppose to pull from</p>

<pre><code>  Scott|Michael|23 Guist Rd|Scranton|PA|12345
  Beesly|Pam|4359 Justin Ave|Pittsburg|PA|44709
  Halpert|Jim|450 Sawdust Lane|Chicago|IL|55830
  Braff|Zach|33082 Buckthorn Rd|Dalton|OH|40988
  Keenan|Maynard|89 Treeview Blvd|Page Springs|AZ|85377
  Hedburg|Mitch|9000 Beerbohm Dr|Cadiz|OH|43990
  Cook|Dane|23 River Rd|Krabill|OR|66264
  Griffin|Lois|123 Our Street|Quahog|RI|48756
</code></pre>

<p>Now i did save the record.txt under my www wamp file i just don't know what I did wrong?</p>
