Reading a local file
Posted: Mon Sep 15, 2003 10:16 am
Hello guys could someone help me with a little problem.
I am trying to write a prog that lets me email a newsletter to people who have registered on my website using the following steps
1) User writes newsletter, saves as plain text file
2) visits admin webpage, browse for local file, then submit
3) file is read the email to all users who request it.
After having a look at 'file' type in forms i created the form section of the page as follows
after this is submitted the variable $_FILES['file'] containes an encoded array. All i need is the plain text version of the file. When I change the ENCTYPE to 'plain text etc', $_FILES['file'] contains nothing.
Any ideas
I am trying to write a prog that lets me email a newsletter to people who have registered on my website using the following steps
1) User writes newsletter, saves as plain text file
2) visits admin webpage, browse for local file, then submit
3) file is read the email to all users who request it.
After having a look at 'file' type in forms i created the form section of the page as follows
Code: Select all
<form name="emailnewsletter" method="post" action="<? $PHP_SELF ?>" ENCTYPE="application/x-www-form-urlencoded">
<table width="82%" border="1" cellpadding="0" cellspacing="0" bordercolor="#999933">
<tr bordercolor="#009966">
<td width="26%"><div align="center"><font color="#009966"><strong>Sale Number</strong></font></div></td>
<td width="17%"> <div align="left">
<input name="salenumber" type="text" id="salenumber" size="10" maxlength="3">
</div></td>
<td width="57%">
<input type="file" size=40 name="file">
<input name="submit_leo" type="submit" id="testleo3" value="Test to Leo">
<input name="submit_denhams" type="submit" id="testdenhams4" value="Test to Denhams">
<input name="submit" type="submit" id="submit" value="Submit"></td>
</tr>
</table>
</form>Any ideas