Skip navigation
Isabel_Scota
Currently Being Moderated

Submit Button with CGI

Jun 11, 2012 1:03 PM

I have a form and I would like for my submit button to email me the contents once the person has completed the form.

 

Here is my code:

 

<body>

<h3>Contact Us</h3>

<form method="get" enctype="text/plain" name="Contact" id="Contact">

  <p>

    <label for="firstname2"><span class="star">*</span>First Name:</label>

    <input name="firstname" type="text" id="firstname2" maxlength="20" />

  </p>

  <p>

    <label for="lastname"><span class="star">*</span>Last Name:</label>

    <input name="lastname" type="text" id="lastname" maxlength="20" />

  </p>

  <p>

    <label for="email"><span class="star">*</span>Email Address:</label>

    <input type="text" name="email" id="email" />

  </p>

  <p>

    <label for="emailconfirmed"><span class="star">*</span>Confirm Email Address:</label>

    <input type="text" name="emailconfirmed" id="emailconfirmed" />

  </p>

  <p>

    <label for="subject"><span class="star">*</span>Subject:</label>

    <input name="subject" type="text" id="subject" maxlength="30" />

  </p>

  <p>

    <label for="message"><span class="star">*</span>Message:</label>

    <textarea name="message" id="message" cols="45" rows="5"></textarea>

  </p>

  <p>Submit

   <input type="submit" name="submit" id="submit" value="Submit" />

  </p>

</form>

</body>

 

 

Here is the CGI code that my web host said to use: <input type='hidden' name='cgiemail-mailopt' value='sync'>

 

Do I just plug it in where I have the text highlighted in my code?

 
Replies
  • Currently Being Moderated
    Jun 11, 2012 1:15 PM   in reply to Isabel_Scota

    That would get you part of the way there.

     

    What is the name of the script file that is to process the form's data?  That should go in the action attribute of the form tag, e.g.,

     

    <form method="get" enctype="text/plain" name="Contact" id="Contact" action="YOUR_SCRIPT_FILENAME">

     

    And you probably also want the method to be "POST" not "GET".

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 25, 2012 4:01 PM   in reply to Isabel_Scota

    Let's see your page's code after you have copied in the code, please.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 27, 2012 1:02 AM   in reply to Isabel_Scota

    If you want to make forms that work take a look here it's free

     

    PHP FormMail Generator

     

    All the forms on the web site that I built were made using PHP FormMail Generator and all work just fine.

     

    If you want to take a look at them in action you can test the form you have created before you download it and place it on your site.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 1, 2012 1:39 AM   in reply to Isabel_Scota

    Isabel

     

    After you have created and downloaded your form from  FormMail Generator you place the files on your site in the root directory.

     

    What I do is create a new folder and call it what ever,

    For contact I have a contact folder, in side are the files downlaoded from FormMail Generator

    Admin.php

    email_traffics_log.php

    form.lib.php

    form.php

    phpmailer.php

     

    then on my contact.html page I have the following to call the form for display on my page.

     

       <iframe frameborder="none" src="contact/form.php" allowTransparency="true" style="width:400px;height:500px; border:none" scrolling="auto"></iframe>

     

    Obviously you don't have to use iframe like I have.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 4, 2012 11:50 AM   in reply to Isabel_Scota

    Are you able to run PHP on your server?  Have you uploaded the files suggested in the previous post?  Your iframe is looking for this file -

     

    contact/form.php

     

    but it doesn't seem to be finding it.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points