Avatar of SheharyaarSaahil
Flag 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 ^_^
Scripting Languages

Avatar of undefined
Last Comment

8/22/2022 - Mon

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question

>> 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.

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');



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.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.

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?
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.

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 :)