Hey,
I'm trying to make a site for a restaurant that has an updatable menu.
I'd like to have the client be able to either A) copy and paste the menu from a Word file then use a php script to write the menu to a text file, or 😎 allow the client to upload a text file.
I have been successful in writing to a text file from the client's form input, but spaces left by the client show up as another character and the accented "e" (that's in "sauteed") shows up as an accented capital E.
I'm not sure if the code is relevant, but here you go:
<?php
$writestring = "\"$menu\"";
$filepointer = fopen("data.txt","w");
fwrite($filepointer,$writestring);
fclose($filepointer);
?>
I know how create a form "file upload" button in html but I'm not sure how to handle the file afterwards.
This is what I have so far:
<form action="handler.php" method="post" enctype="multipart/form-data"> _
<input type="file" name="user_icon" /> _
<input type="submit" name="submit" />
So what should I write for the handler.php?
Any help on either method would be appreciated. Thanks in advance.