Tutorial on forms for the web?

Posted:
in Genius Bar edited January 2014
Well, it looks like I have to get my hands grody with web forms, and haven't a clue where to start in this new shiny standards-based web.



Anyone have a pointer or three to lend?



Basically I need to allow the user to upload a file, where the backend will fire off a batch job, then present the results back to the user as a new file.

Comments

  • Reply 1 of 4
    ast3r3xast3r3x Posts: 5,012member
    I like to handle uploads with PHP. But for learning about forms and stuff, check out www.w3schools.com. Although I have a feeling you know all of that already. You probably mean more advanced stuff.
  • Reply 2 of 4
    torifiletorifile Posts: 4,024member
    Quote:

    Originally posted by Kickaha

    Well, it looks like I have to get my hands grody with web forms, and haven't a clue where to start in this new shiny standards-based web.



    Anyone have a pointer or three to lend?



    Basically I need to allow the user to upload a file, where the backend will fire off a batch job, then present the results back to the user as a new file.




    What language will you be using? PHP? Perl? I'd recommend perl if you're going to be doing text processing or server related stuff on the file.
  • Reply 3 of 4
    podmatepodmate Posts: 183member
    From what I can tell this is not so much a HTML forms questions as it is a file upload question.

    Apache/PHP can be configured to allow file uploads.

    Apache/Perl can also do the same, but is not as easy to do (so my sysadmin tells me).



    Parsing through a file is better left to Perl. PHP's regexp set is nowhere as useful as perl's.



    Allowing users to upload a file to your server does have some secuirty implications.

    IMHO, I would set up a form with TEXTAREA fields (for large anounts of free flowing text) and have the users copy and paste the data into the TEXTAREA fields. Then submit the form to either a .cgi (perl) or .php script that will parse the fields and build the output.



    Be sure to remeber to CHECK the data and to take care of any system commands that might find their way into the text.



    If you can outline the process a bit more I bet we can give more helpful ideas.
  • Reply 4 of 4
    kickahakickaha Posts: 8,760member
    The backend tools are all done, so the entire Perl/PHP issue is moot. (BTW, it's all in Python, so nyah. )



    I want users to be able to upload an XML file for batch processing on our machines. The results, also XML, will be then presented to the user.



    I need three things: 1) uploading the file, 2) triggering the process (just a shell command), 3) presenting the data.



    Edit: Okay, it looks like this page gives the basic format I want, and I just need to modify it, and hook it into the backend.
Sign In or Register to comment.