Link to home
Get AccessLog in
Avatar of SheharyaarSaahil
SheharyaarSaahilFlag for United Arab Emirates

asked on

can you edit this script?

i have this form >> www.peaceworldgroup.com/careers.htm
to process it, im using a cgi script which i have zipped and uploded here >> http://www.alaynah.net/fdbkscrpt.zip

my question is, if i want to add another field to this form, how can i edit the above script to add the new information.
im very much new to cgi scripting, just want to get some idea, how to deal with this language, its totally different from html or css type thingies! :-S

thanks ^_^
ASKER CERTIFIED SOLUTION
Avatar of Perl_Diver
Perl_Diver

Link to home
membership
This content is only available to members.
To access this content, you must be a member of Experts Exchange.
Get Access
Avatar of Perl_Diver
Perl_Diver

>> my question is, if i want to add another field to this form, how can i edit the above script to add the new information.

add the new form field onto the list of form field variables:

my $position = $field{'position'};      
my $name = $field{'name'};      
my $email = $field{'email'};      
my $mob = $field{'mob'};      
my $age = $field{'age'};      
my $country = $field{'country'};      
my $visa = $field{'visa'};      
my $marital = $field{'marital'};      
my $gender = $field{'gender'};      

if you add a form field named 'phone' to your CGI form, add this line to the script:

my $phone = $field{'phone'};

same for all single value form fields. If you add a multi-valued form field to your form use an array get the form field data directly from the param() function:

my @data = $q->param('dates') ;

assumes you have a form field named 'dates' that returns more than one value. Such as a series or checkboxes or input tags that all have the same name.
Avatar of Tintin
Perl Diver.

What's the point in putting all the values into a hash, when you create scalars for everything, ie:

my %field = $q->Vars;
my $position = $field{'position'};  

You might as well just do

my $position = $q->param('position');

   
Tintin:

I agree, it was just easy to change/add what little I did to the existing script, which already had the %field stuff in it.
Avatar of SheharyaarSaahil

ASKER

Perl... thanks for the fine and clean re-write of the script :)
but when i uploaded it.... it didn't work! =(

are you sure you are not missing any important thing in your script from the original one.... im sorry but i cannot understand this language to differentiate them! :shy:
Perl... are you there?
Define "didn't work".  Error messages?  Unexpected behaviour?  No output?  What?
Yes, please define does not work.
leave it.... we hired a developer who wrote a php script for the required forms and everything is working smoothly now :)