Hello,
I am having trouble getting my php page to pickup what a user has typed in a form and then saving it to a file.
Its opening the file fine, its just the getting the info part which does not seem to be working.
here is my code:
[code=php]
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”
“http://www.w3.org/TR/html4/loose.dtd”>
<html>
<head>
<title>Writing to File</title>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
<?php
@extract($_POST);
if(is_writable(‘formdata.csv’))
{
$fp = fopen(‘formdata.csv’,’a’);
$content = “$lastname,$firstname,$emailn”;
fwrite($fp,$content);
fclose($fp);
}
else
{ echo’File is not writable’; }
?>
</head>
<body>
<FORM id=”form1″ name=”form1″ method=”post” action=”#”>
<P>
<LABEL for=”firstname”>First name: </LABEL>
<INPUT type=”text” id=”firstname”><BR>
<LABEL for=”lastname”>Last name: </LABEL>
<INPUT type=”text” id=”lastname”><BR>
<LABEL for=”email”>email: </LABEL>
<INPUT type=”text” id=”email”><BR>
<BR>
<INPUT type=”submit” value=”Send”> <INPUT type=”reset”>
</P>
</FORM>
</body>
</html>