There is a web application designed for this called wufoo <a href="http://www.wufoo.com">www.wufoo.com</a> there is also a google forms that does this and puts the results i<span></span>n a spreadsheet.<br><br>On Thursday, May 2, 2013, Lisa Kachold  wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Joe!<div>... </div><div><br></div><div>Let's go brainstorm the possibilities:</div><div><br><div class="gmail_quote">
On Thu, May 2, 2013 at 4:15 PM,  <span dir="ltr"><<a href="javascript:_e({}, 'cvml', 'joe@actionline.com');" target="_blank">joe@actionline.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
How to get form input results written to a file?<br>
<br>
On one of my websites, I use the html "form input" code shown below<br>
for visitors to input their email address to be emailed to me. This<br>
works fine.<br>
<br>
What would I need add to this code to get the same submitted<br>
information written to a file in my web hosted space on my web<br>
host's server in addition to having the information sent to me by<br>
email?<br>
<br>
<form action=<a href="http://www.bluehost.com/bluemail" target="_blank">http://www.bluehost.com/bluemail</a> method=POST><br>
 <input type=hidden name=sendtoemail value=<a href="javascript:_e({}, 'cvml', 'joe@vsiq.com');" target="_blank">joe@vsiq.com</a>><br>
 Please enter your email address:<p><br>
 <input type=text name=mailfrom size=30 maxlength=70><br>
 <input type=submit value=Send><br>
</form><br></blockquote><div> </div><div>It appears you are using bluehost's mailer called BlueMail.  This email form help request would be most effective posted to Bluehost's support forums?  <a href="http://www.bluehostforum.com/archive/index.php/t-432.html" target="_blank">http://www.bluehostforum.com/archive/index.php/t-432.html</a></div>

<div><br></div><div>Of course, you can't simply tell it to echo $mailfrom to a file?  Not without invoking php or another system call.  </div><div><br></div><div>I am sure you don't HAVE to use BlueHost's BlueMail CGI; HTML mail forms are pretty fun to write and use, however bluehost might have some peculiar constraints for obvious security reasons?</div>

<div><br></div><div>Basic BlueMail How to:</div><div><p style="margin:1em 0px;color:rgb(109,110,113);font-family:'Segoe UI','Gill Sans','Gill Sans MT',GillSans,'Trebuchet MS',Arial,sans-serif;line-height:22px">

<font size="1">Log into the cPanel navigate to the CGI center.   </font><span style="font-size:x-small">In the cgi center click on BlueHost.com. </span><span style="font-size:x-small">On the BlueHost.com page, there is a functional form. Modify the email address listed in the default example to one on your account. After saving this form to a file, and uploading it, test it.  Once successful modify to fill needed requirements.  </span><span style="font-size:x-small">Please note the critically important parts are in the first couple lines, and the last few lines of the code for the form. The BlueHost.com page contains additional details about other available fields.  Most standard form mail fields are acceptable to use.  </span></p>

<p style="margin:1em 0px;color:rgb(109,110,113);font-family:'Segoe UI','Gill Sans','Gill Sans MT',GillSans,'Trebuchet MS',Arial,sans-serif;line-height:22px"><span style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px;line-height:normal;background-color:rgb(250,250,250)">Remember Bluemail will only send messages to an email address setup on your Bluehost account. If you wish to deliver the email elsewhere, you may setup an email forwarder instead.  OR USE another cgi!</span></p>

<p style="margin:1em 0px;font-family:'Segoe UI','Gill Sans','Gill Sans MT',GillSans,'Trebuchet MS',Arial,sans-serif;line-height:22px"><span style><span style="font-family:arial;line-height:normal">Here's a full well written explanation of using HTML forms:  </span><a href="http://www.w3.org/wiki/HTML_forms_-_the_basics" style="color:rgb(109,110,113);font-family:arial;line-height:normal" target="_blank">http://www.w3.org/wiki/HTML_forms_-_the_basics</a> - You can make some nice tricked out form fields and buttons!</span></p>

<p style="margin:1em 0px;font-family:'Segoe UI','Gill Sans','Gill Sans MT',GillSans,'Trebuchet MS',Arial,sans-serif;line-height:22px"><span style="font-family:arial;line-height:normal">Clearly you should have PHP available, so you can use a nice expanded radio button jazzed up script/form that allows your users to upload a file that's sent with the email, or writes to a file (as you want).  James Huggins developed and runs one on a BlueHost (that gives you the option of saving to a file as well as emailing out form field input).</span></p>

<p style="margin:1em 0px;font-family:'Segoe UI','Gill Sans','Gill Sans MT',GillSans,'Trebuchet MS',Arial,sans-serif;line-height:22px"><a href="http://www.jamesshuggins.com/h/hefs/huggins-email-form-script.htm" style="font-family:arial;line-height:normal" target="_blank">http://www.jamesshuggins.com/h/hefs/huggins-email-form-script.htm</a><span style="font-family:arial;line-height:normal">  free</span></p>

</div><div>Of course you can also use PERL (which they also have available); just place the scripts into the <span style="background-color:rgb(249,249,249);font-family:verdana,arial,sans-serif;font-size:11px">directory parallel to public_html or in the directory under public_html/cgi-bin (just use whichever is already setup there) and make sure that the script file has executable permissions (755) and then check to see that you have enabled exegCGI in your management portal.  You might verify the location of perl with a command line "which perl" if you have ssh access.  According to some of the other users on the forums, in order to use server side includes with perl, you will need to specify </span><span style="background-color:rgb(249,249,249);font-family:verdana,arial,sans-serif;font-size:11px">"#!/ramdisk/bin/perl" as the first line in each script (rather than the #!/usr/bin/perl line).  You should be able to test run your scripts via "perl scriptname" (it might give an error as it expects input), to ensure it runs. </span></div>

<div><span style="background-color:rgb(249,249,249);font-family:verdana,arial,sans-serif;font-size:11px"><br></span></div><div><span style="background-color:rgb(249,249,249)"><div><font face="verdana, arial, sans-serif"><span style="font-size:11px">#!/ramdisk/bin/perl</span></font></div>

<div><font face="verdana, arial, sans-serif"><span style="font-size:11px"># <a href="http://form2file.pl" target="_blank">form2file.pl</a> CGI</span></font></div><div><font face="verdana, arial, sans-serif"><span style="font-size:11px"># Sporked from Various HowTo's</span></font></div>

<div><font face="verdana, arial, sans-serif"><span style="font-size:11px"># ActionOnline/2013</span></font></div><div><font face="verdana, arial, sans-serif"><span style="font-size:11px"># Called from HTML path/filename</span></font></div>

<div><font face="verdana, arial, sans-serif"><span style="font-size:11px"><br></span></font></div><div><font face="verdana, arial, sans-serif"><span style="font-size:11px">use strict;</span></font></div><div><font face="verdana, arial, sans-serif"><span style="font-size:11px">use CGI qw/:standard/;</span></font></div>

<div><font face="verdana, arial, sans-serif"><span style="font-size:11px">use CGI::Carp qw(fatalsToBrowser);</span></font></div><div><font face="verdana, arial, sans-serif"><span style="font-size:11px"><br></span></font></div>

<div><font face="verdana, arial, sans-serif"><span style="font-size:11px"># Parse Form Data</span></font></div><div><font face="verdana, arial, sans-serif"><span style="font-size:11px"># Requires a matching $variable for each of your form input questions</span></font></div>

<div><font face="verdana, arial, sans-serif"><span style="font-size:11px"><br></span></font></div><div><font face="verdana, arial, sans-serif"><span style="font-size:11px">my $mailfrom=param("name");</span></font></div>

<div><font face="verdana, arial, sans-serif"><span style="font-size:11px"><br></span></font></div><div><font face="verdana, arial, sans-serif"><span style="font-size:11px"># For example to add additional entries to be saved from your form:</span></font></div>

<div><font face="verdana, arial, sans-serif"><span style="font-size:11px"># my $comment=param("comment");</span></font></div><div><font face="verdana, arial, sans-serif"><span style="font-size:11px"><br></span></font></div>

<div><font face="verdana, arial, sans-serif"><span style="font-size:11px">open(FILE, ">>file.txt") || die "can't write to file.txt $!";</span></font></div><div><font face="verdana, arial, sans-serif"><span style="font-size:11px"><br>

</span></font></div><div><font face="verdana, arial, sans-serif"><span style="font-size:11px">print FILE "$mailfrom\n";</span></font></div><div><font face="verdana, arial, sans-serif"><span style="font-size:11px">print FILE "\n";</span></font></div>

<div><font face="verdana, arial, sans-serif"><span style="font-size:11px"><br></span></font></div><div><font face="verdana, arial, sans-serif"><span style="font-size:11px">close(FILE);</span></font></div><div><font face="verdana, arial, sans-serif"><span style="font-size:11px"><br>

</span></font></div><div><font face="verdana, arial, sans-serif"><span style="font-size:11px">print header(),</span></font></div><div><font face="verdana, arial, sans-serif"><span style="font-size:11px">start_html(-title=>'File Created'),</span></font></div>

<div><font face="verdana, arial, sans-serif"><span style="font-size:11px">'File created!',</span></font></div><div><font face="verdana, arial, sans-serif"><span style="font-size:11px">end_html();</span></font></div>

<div><font face="verdana, arial, sans-serif"><span style="font-size:11px"><br></span></font></div><div><font face="verdana, arial, sans-serif"><span style="font-size:11px"># end </span></font></div><div style="font-family:verdana,arial,sans-serif;font-size:11px">

<br></div></span></div><div><span style="background-color:rgb(249,249,249);font-family:verdana,arial,sans-serif;font-size:11px"><br></span></div><div><font face="verdana, arial, sans-serif"><span style="font-size:11px">NOTE:  The most frequent snafu's met with cgi-scripting are PATH based!  Try both server side paths ["../cgi-bin/<a href="http://form2file.pl" target="_blank">form2file.pl</a>"] and URLs ["<a href="http://www.myhost.com/cgi-bin/form2file.pl" target="_blank">http://www.myhost.com/cgi-bin/form2file.pl</a>" since you can't see how the server is setup usually related to server side scripting and security - it's fastest to try.  Also watch for permissions and be sure that you can run the scripts locally if you have ssh!</span></font></div>

<div><font face="verdana, arial, sans-serif"><span style="font-size:11px"><br></span></font></div><div><span style="background-color:rgb(249,249,249);font-family:verdana,arial,sans-serif;font-size:11px"><b><i>So that will create your file info, but what about email?  Surprise!  </i></b></span></div>

<div><span style="background-color:rgb(249,249,249);font-family:verdana,arial,sans-serif;font-size:11px"><b><i><br></i></b></span></div><div><font face="verdana, arial, sans-serif"><span style="font-size:11px"><b><i>Using Javascript you can invoke both the perl script-let below and the bluemail tool:</i></b></span></font></div>

<div><font face="verdana, arial, sans-serif"><span style="font-size:11px"><br></span></font></div><div><font face="verdana, arial, sans-serif"><span style="font-size:11px"><br></span></font></div><div><font face="verdana, arial, sans-serif"><span style="font-size:11px">############################Start JavaScript 2 Script Submit###############################</span></font></div>

<div><font face="verdana, arial, sans-serif"><span style="font-size:11px"><div><html></div><div><head></div><div><script language="Javascript"></div><div><!--</div><div>function OnButton1()</div>

<div>{</div><div>    document.Form1.action = "<a href="http://myhost.com/cgi-bin/form2file.pl" target="_blank">http://myhost.com/cgi-bin/form2file.pl</a>"</div><div>    // document.Form1.target = "_blank";    // Open in a new window</div>

<div><br></div><div>    document.Form1.submit();             // Submit the page</div><div><br></div><div>    return true;</div><div>}</div><div><br></div><div>function OnButton2()</div><div>{</div><div>    document.Form1.action = "<a href="http://www.bluehost.com/bluemail" target="_blank">http://www.bluehost.com/bluemail</a>"</div>

<div>    document.Form1.target = "_blank";    // Open in a new window</div><div><br></div><div>    document.Form1.submit();             // Submit the page</div><div><br></div><div>    return true;</div><div>}</div>

<div>--></div><div></script></div><div><br></div><div><noscript>You need Javascript enabled for this to work</noscript></div><div></head></div><div><body></div><div><!-- create the form --></div>

<div><br></div><div><br></div><div><form name="Form1" method="post"></div><div><br></div><div><!-- Add the data entry bits --></div><div><br></div><div> <input type=hidden name=sendtoemail value=<a href="javascript:_e({}, 'cvml', 'joe@vsiq.com');" target="_blank">joe@vsiq.com</a>></div>

<div> <span style="white-space:pre-wrap"> </span>Please enter your email address:<p></div><div> <span style="white-space:pre-wrap">       </span><input type=text name=mailfrom size=30 maxlength=70></div>
<div><br></div><div><!-- Add some buttons --></div><div><INPUT type="button" value="Button1" name=name onclick="OnButton1(); OnButton2();"></div><div><!-- close the form --></div>

<div></form></div><div></body></div><div></html></div></span></font></div><div><span style="background-color:rgb(249,249,249);font-family:verdana,arial,sans-serif;font-size:11px"><br></span></div><div><span style="background-color:rgb(249,249,249);font-family:verdana,arial,sans-serif;font-size:11px"># End Javascript example</span></div>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
---------------------------------------------------<br>
PLUG-discuss mailing list - <a href="javascript:_e({}, 'cvml', 'PLUG-discuss@lists.phxlinux.org');" target="_blank">PLUG-discuss@lists.phxlinux.org</a><br>
To subscribe, unsubscribe, or to change your mail settings:<br>
<a href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" target="_blank">http://lists.phxlinux.org/mailman/listinfo/plug-discuss</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div><br></div>(503) 754-4452 Android<br>(623) 239-3392 Skype<br>(623) 688-3392 Google Voice<br>**<br><a href="http://it-clowns.com" target="_blank">it-clowns.com</a> <br>

Chief Clown<br><br><br><br><br><br><br><br><br><br><br><br><br><br>
</div>
</blockquote><br><br>-- <br>A mouse trap, placed on top of your alarm clock, will prevent you from rolling over and going back to sleep after you hit the snooze button.<br><br>Stephen<br>