Help - Search - Members - Calendar
Full Version: Help with form submit
HTMLHelp Forums > Web Authoring > Markup (HTML, XHTML, XML)
HeidinChrist
I just yesterday learned html coding, and have creted two forms on my website. The form has a mailto action, and upon several delivery attempts and researching the web all night long, i've come to realize that I either need a CGI script or...
I have a CGI bin through admin tools in my domain server. I am not sure if I should just upload my html text file, or if I need to upload a script file??? The CGI bin contains FEEDS.cgi and FORMS.cgi. What do I need to do to enable this coding and receive the forms, NOT blank, but filled out? I did upload perlscripts through a website lastnight, but can not figure out how to enable/use. I might not have o use them if my domain (with CGI bin) is form ready.
You can visit www.concretepumpsales.net, select advertising on left (pg. 5) and select advertising quote request. Or, my html coding is as follows (for one of two forms)
PLEASE help! Thank you in advance for any and all information you can provide.

very sincerely,
ms. heidi wub.gif wub.gif wub.gif

<FORM ACTION="mailto:adquote@concretepumpsales.net">
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="4" WIDTH="90%">
<TR>
<td class="label">
Name
</td>
<td class="variable">
<input type="text" name="Contact_FirstName" size="35" class="medium">
</td>
</tr>
<tr>
<td class="label">
Company
</td>
<td class="variable">
<input type="text" name="Contact_Organization" size="35" class="medium">
</td>
</tr>
<tr>
<td class="label">
Pump Make
</td>
<td class="variable">
<input type="text" name="Pump_Make" size="35" class="medium">
</td>
</tr><tr>
<td class="label">
Pump Model
</td>
<td class="variable">
<input type="text" name="Pump_Model" size="35" class="medium">
</td>
</tr><tr>
<td class="label">
Year
</td>
<td class="variable">
<input type="text" name="Year" size="35" class="medium">
</td>
</tr>
<tr>
<td class="label">
Pump Hours
</td>
<td class="variable">
<input type="text" name="Pump_Hours" size="35" class="medium">
</td>
</tr>
<tr>
<td class="label">
Truck Make
</td>
<td class="variable">
<input type="text" name="Truck_Make" size="35" class="medium">
</td>
</tr>
<tr>
<td class="label">
Truck Year
</td>
<td class="variable">
<input type="text" name="Truck_Year" size="35" class="medium">
</td>
</tr>
<tr>
<td class="label">
Truck Miles
</td>
<td class="variable">
<input type="text" name="Truck_Miles" size="35" class="medium">
</td>
</tr>
<tr>
<td class="label">
Mailing Address
</td>
<td class="variable">
<input type="text" name="Mailing_Address" size="35" class="medium">
</td>
</tr>
<tr>
<td class="label">
City
</td>
<td class="variable">
<input type="text" name="City" size="35" class="medium">
</td>
</tr>
<tr>
<td class="label">
State
</td>
<td class="variable">
<input type="text" name="State" size="35" class="medium">
</td>
</tr>
<tr>
<td class="label">
ZIP Code
</td>
<td class="variable">
<input type="text" name="Zip_Code" size="35" class="medium">
</td>
</tr>
<tr>
<td class="label">
Contact Phone
</td>
<td class="variable">
<input type="text" name="Contact_Phone" size="35" class="medium">
</td>
</tr>
<tr>
<td class="label">
Email Address
</td>
<td class="variable">
<input type="text" name="Contact_Email" size="35" class="medium">
</td>
</tr>
<TR>
<TD>&nbsp;</TD>
<TD>
<INPUT type="submit" name="submit" value="Submit">
<INPUT type="reset" name="reset" value="Reset">
</TD></TR>
</TABLE>
</FORM>
pandy
You need a script, you ne4ed to configure it and you need to point the action attribute to that script. Maybe that FORMS.cgi is such a script. Was it put there by your host? Open it in a text editor and see what it is. There's probably comments that tell what it does.
HeidinChrist
QUOTE(pandy @ Mar 20 2007, 11:15 AM) *

You need a script, you ne4ed to configure it and you need to point the action attribute to that script. Maybe that FORMS.cgi is such a script. Was it put there by your host? Open it in a text editor and see what it is. There's probably comments that tell what it does.

1.) thank you kindly for the response. Here's what the form.cgi reads..question is, how do implement this to send my forms? to I have to include this in my html coding for the form(s) already created? All of it? part? I know these sound like incompetent questions, but at least html coding is easily decipherable and understandable. THIS is NOT! For me at least.

#!/usr/bin/perl
############################################
#
# forms.cgi - form processor for forms created though admin panel
#
# © 2003 vDeck.com
#
############################################
use strict;
use warnings;
use CGI;
use vDeckPublic;
use DBI;

use constant F_ID => 0;
use constant F_FORMID => 1;
use constant F_FIELDNAME => 2;
use constant F_FIELD_TYPE => 3;
use constant F_FIELD_DEFAULT => 4;
use constant F_FIELD_TAINTCHECK => 5; # for future use
use constant F_FIELD_RANK => 6;

my $q = CGI->new();

# find homedir
my $homedir = '';
$ENV{DOCUMENT_ROOT} =~ m|(/home/[\w\-]+)| and $homedir = $1;

# print "Content-type: text/plain\n\n--$homedir--"; exit(0);

my $vdeck = vDeckPublic->new({ -db => "DBI:CSV:f_dir=$homedir/.panel/data/;csv_eol=\n;",
-user => '',
-pass => '' });

$homedir || $vdeck->fatal_error("Can't determine home directory");

my $form_id='';

my %var = $q->Vars();
foreach my $f_name(keys %var){
if($f_name =~ /^_(\w+)formid$/){
$q->param($f_name) =~ /(\d+)/ and $form_id = $1;
last;
}
}

$form_id || $vdeck->fatal_error("Invalid form ID. Please check your SSI code!");

# WHERE form_id='$form_id'
my $form_fields = $vdeck->db_query("SELECT * FROM form_fields WHERE form_id='$form_id'");
defined $form_fields->[0] or $vdeck->fatal_error("No form fields defined - please check your form design.");

my %form_field = ();

for (@{$form_fields}) {
my $field_name = $_->[2];
$field_name =~ s/\W/_/g;
defined ( $q->param($field_name) ) and $form_field{$field_name} = $q->param($field_name);
}

# everything OK, so send e-mail
my $form_meta = $vdeck->db_query("SELECT * FROM form_meta WHERE id='$form_id'",'rowarray');
defined $form_meta->[0] or $vdeck->ssi_error("Invalid form ID. Please check your SSI code!");

my $to = $form_meta->[3];
my $cc = $form_meta->[4];
my $bcc = $form_meta->[5];
my $message = $form_meta->[6];
my $redirect = $form_meta->[7] || '/v-web/forms/thanks.htm';

while ($message =~ /\[% (\S+) %\]/s) {
my $attr = $1;
$message =~ s/\[% $attr %\]/$form_field{$attr}/gs;
}

$vdeck->send_email({ -to => $to,
-from => $to,
-cc => [split ',', $cc],
-bcc => [split ',', $bcc],
-subject => "Feedback: from $form_meta->[2]",
-message => $message
});

print $q->redirect($redirect);
exit(0);
Christian J
I found these hidden away among the support pages: http://www.vdeck.com/help/index.php?id=50 you must probably go through both the
Adding to Site (web builder) and Installing wizards.
Darin McGrew
What documentation do you have about using this vDeck system? It looks like you shouldn't need to modify the CGI program itself. It looks like all the configuration is done via external configuration files.
HeidinChrist
Thank you both. Can you provide me an example of how this would be used within my html code? Do i need to add any of the scrpt info in my html code?
HeidinChrist
I am very sorry, I need to clarify a little bit. Maybe I can not use the CGI bin located within VDeck because: although my server(VDeck) has web building capabilities, I was not satisifed with the functionality and lack of design tools. I use Serif as my web builder, and export my files to my domain/server. Would this be why I am not able to email the form, why I need to use add'l cgi script?
HeidinChrist
I posted a qu for having form mail sent to me. I did attempt to use VDeck's help feature, went into to plugins, formmail, etc etc etc, copied html coding into my codes as stated, published to my site, test filled my form, selected submit, and it is still not operative. It will not send anything; please view this at:
http://www.concretepumpsales.net/page7.html
thank you for your help wub.gif blink.gif
Darin McGrew
When I submit the form, I get
QUOTE
Fatal Error!

Invalid 'to' e-mail address:
It looks like you still need to configure the email address that the form data should be sent to.
pandy
A form always needs a script to handle it (if you don't use mailto, which you are right in not wanting to do).
Christian J
QUOTE(HeidinChrist @ Mar 20 2007, 06:28 PM) *

Thank you both. Can you provide me an example of how this would be used within my html code? Do i need to add any of the scrpt info in my html code?


See http://htmlhelp.com/faq/html/forms.html#form-howto
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.