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

Eric Cope eric.cope at gmail.com
Tue Jul 26 14:17:05 MST 2011


Hey Joe,
That script has the basics to get it working, but there is a big caveat. You
need to scrub the form input to prevent ALL malicious inputs from reaching
the file. I'd hate to see someone put "rm -rf /" in the file and execute it.
There are all sorts of nasty things to put in a file, that you need to be
very careful. I can help with the file, but I am swamped as you can tell.

Thanks,
Eric

On Tue, Jul 26, 2011 at 1:42 PM, <joe at actionline.com> wrote:

>
> A few days ago, I submitted the subject question to PLUG:
>
> Still don't have a working solution, and have not yet been able to find a
> work-for-hire quote. With further searching, I found this:
>
> http://www.howtoplaza.com/save-web-form-data-text-file
>
> And from the suggestions there, I created these three files:
> 1) "formdata.txt" -- containing Name,Email
> 2) "process-form-data.php" containing this code:
>
> <?php
> $name = $_POST['name'];
> $email = $_POST['email'];
> $fp = fopen("formdata.txt", "a");
> $savestring = $name . "," . $email . "n";
> fwrite($fp, $savestring);
> fclose($fp);
> echo "Your data has been saved in a text file.>";
> ?>
>
> 3) "input-text.htm" containing this code:
>
> <form name=webform id=webform method=post action=process-form-data.php>
> Name: <input type=text name=name id=name> <br>
> Email: <input type=text name=email id=email> <br>
> <input type=submit name=s1 id=s1 value=Submit></form>
>
> When I try to run it, it just displays the php code
> and I see these messages repeated several times:
>
> QPainter::begin: Widget painting can only begin as a result of a paintEvent
> QPainter::translate: Painter not active
> QPainter::setClipRect: Painter not active
> QPainter::font: Painter not active
> QPainter::setFont: Painter not active
> QPainter::setPen: Painter not active
> QPainter::worldTransform: Painter not active
> QWidget::repaint: Recursive repaint detected
> QWidget::repaint: Recursive repaint detected
>
> What do I need to do to get this to work?
>
>
>
> ---------------------------------------------------
> 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/20110726/95c9fedb/attachment.html>


More information about the PLUG-discuss mailing list