Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

HTML Forms

  • 05-10-2000 5:10pm
    #1
    Registered Users, Registered Users 2 Posts: 4,276 ✭✭✭


    yup your right, you need a cgi script to send it, all you have to do is change the path for it to send


Comments

  • Registered Users, Registered Users 2 Posts: 2,660 ✭✭✭Baz_


    Hey I've just started HTML forms and I'm having a little trouble with getting stuff to submit.

    The code is:
    <HTML>
    <HEAD>
    <TITLE>Student Details Form</TITLE>
    </HEAD>
    <BODY>
    <H3>Student Details</H3>
    <FORM METHOD="POST" ACTION="/cgi-bin/formmail">
    <INPUT TYPE="hidden" NAME="recipient" VALUE="bazzak14@yahoo.com">
    <INPUT TYPE="hidden" NAME="subject" VALUE="Student Details Form">
    <INPUT TYPE="hidden" NAME="redirect" VALUE="main.html">
    
    <P><STRONG>Name:</STRONG>
    <INPUT TYPE="text" NAME="nom" SIZE="25"></P>
    <P><STRONG>Student ID:</STRONG>
    <INPUT TYPE="text" NAME="StudID" SIZE="15"></P>
    <P><STRONG>Address:</STRONG>
    <TEXTAREA NAME="Address" ROWS="6" COLS="50"></TEXTAREA></P>
    <P><STRONG>Email Address:</STRONG>
    <INPUT TYPE="text" NAME="EmailAdd" SIZE="20"></P>
    <P><STRONG>Subjects:</STRONG><BR>
    Programming
    <INPUT NAME="subjects" TYPE="checkbox" VALUE="Programming"> 
    Maths
    <INPUT NAME="subjects" TYPE="checkbox" VALUE="Maths"> 
    SAD
    <INPUT NAME="subjects" TYPE="checkbox" VALUE="SAD"> 
    Networking
    <INPUT NAME="subjects" TYPE="checkbox" VALUE="Networking"> 
    In Prog
    <INPUT NAME="subjects" TYPE="checkbox" VALUE="IProg">
    </P>
    
    <INPUT TYPE="submit" VALUE="Submit Your Entries">
    <INPUT TYPE ="reset" VALUE="Clear Your Entries">
    </FORM>
    </BODY>
    </HTML>
    

    And methinks that the error lies in the fact that there is no cgi-bin/formmail folder. However what I do want to know is that is such a folder did exist, what file and file type, and what code should be in it.


  • Closed Accounts Posts: 7,488 ✭✭✭SantaHoe


    Send a mail to your host and ask where the formmail cgi is located, unless you have your own.
    You could also replace
    <FORM METHOD="POST" ACTION="/cgi-bin/formmail">
    With
    <FORM METHOD="POST" ACTION="mailto:bazzak14@yahoo.com">
    It's a bit dod*** though, because that'll use the clients own email proggie to send as opposed to the server sending it.
    Or you could get/make a cgi proggie to save the submissions to a file in your web folders.

    ....but don't we all know the feeling of driving to town and suddenly realizing you still have your barn boots on....or reaching over to pick up carrots at the store and having alfalfa fall out of your hair.....


  • Closed Accounts Posts: 1,651 ✭✭✭Enygma


    Yeah the above will work, but it'll put pluses instead of spaces and %40's and all that URL encoding crap.

    If you've got CGI then try this
    #!/usr/bin/perl -w    
    # path to perl ^^^^^
    
    use CGI qw/:all/;
    
    $cgi = CGI-&gt;new();
    
    
    $recipient = $cgi-&gt;param('recipient');
    $subject = $cgi-&gt;param('subject');
    $redirect = $cgi-&gt;param('redirect');
    $name = $cgi-&gt;param('nom');
    $studID = $cgi-&gt;param('StudID');
    $address = $cgi-&gt;param('Address');
    $email = $cgi-&gt;param('EmailAdd');
    $subjects = $cgi-&gt;param('subjects');
    
    open (MAIL, "| mail $recipient") or die $!;
    print MAIL &lt;&lt;EMAIL
    
    From: $name
    To: $recipient
    Subject: $subject
    
    
    Student ID: $studID
    Address: $address
    Email: $email
    Subjects: $subjects
    
    EMAIL
    
    print &lt;&lt;HTML;
    &lt;HTML&gt;
          &lt;HEAD&gt;
          &lt;meta http-equiv="Refresh" content="0; URL=$redirect"&gt;
          &lt;/HEAD&gt;
          &lt;BODY&gt;
          You really want to be &lt;a href="$redirect"&gt;here&lt;/a&gt;.
          &lt;/BODY&gt;
          &lt;/HTML&gt;
    
    HTML
    
    

    That should do it smile.gif


Advertisement