OT: How to use html form input to append input to a file?

keith smith klsmith2020 at yahoo.com
Fri Jul 22 11:42:08 MST 2011



Using PHP would probably be the easiest.

As Kevin said change the form action to the script you want to perform the processingYour form is set to post : method=POSTIn your script process the $_POST array to obtain the data from the form.
Look at fopen and fwrite and see which meets your needs. You probably want to open the file for append. 
http://php.net/manual/en/function.fwrite.php

http://www.php.net/manual/en/function.fopen.php

Hope this helps.

------------------------

Keith Smith

--- On Fri, 7/22/11, Kevin Fries <kfries6 at gmail.com> wrote:

From: Kevin Fries <kfries6 at gmail.com>
Subject: Re: OT: How to use html form input to append input to a file?
To: "Main PLUG discussion list" <plug-discuss at lists.plug.phoenix.az.us>
Date: Friday, July 22, 2011, 10:42 AM

On 07/22/2011 11:37 AM, joe at actionline.com wrote:
> The form input model below works fine to send form input via email, but
> how can I modify it to write (append) the form input to a text file in a
> designated directory in my web hosted space instead of to email?
> 
> <form action=http://www.bluehost.com/bluemail method=POST>
> Email address:<input size=35 maxlength=90 name=Emailfrom><br>
> Enter message:<br>  <textarea name=Message rows 7 cols=50
> wrap=virtual></textarea>
> <input type=hidden name=subject value=Subject>
> <input type=hidden name=required value= message>
> <input type=hidden name=sendtoemail value=feedback at URLaddress.com>
> <input type=hidden name=redirect value=http://www.URLaddress.com>
> <input type=submit value=Send>
> </form>

This form sends its information to a script called bluemail on your web server.  That script sends the email.  So, you will need to either edit that script, or write a new one and redirect the action= in the form command to the new script.

So, it depends on language options.

Kevin Fries
---------------------------------------------------
PLUG-discuss mailing list - PLUG-discuss at lists.plug.phoenix.az.us
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.PLUG.phoenix.az.us/pipermail/plug-discuss/attachments/20110722/3592fefb/attachment.html>


More information about the PLUG-discuss mailing list