Application form help

Hello I am new to php and I just need some advice I can’t seem to figure out what’s wrong with my script here is my contact.php

$to = $_REQUEST[‘sendto’] ;
$from = $_REQUEST[‘Email’] ;
$name = $_REQUEST[‘Name’] ;
$headers = “From: $from”;
$subject = “Web Contact Data”;

$fields = array();
$fields{“position2”} = “position2”;
$fields{“Name”} = “Name”;
$fields{“Address”} = “Address”;
$fields{“Phone”} = “Phone”;
$fields{“Mobile”} = “Mobile”;
$fields{“Email”} = “Email”;
$fields{“datebirth”} = “datebirth”;
$fields{“age”} = “age”;
$fields{“sex”} = “sex”;
$fields{“citizenship”} = “citizenship”;
$fields{“religion”} = “religion”;
$fields{“height”} = “height”;
$fields{“weight”} = “weight”;
$fields{“civil_stat”} = “civil_stat”;
$fields{“spouse”} = “spouse”;
$fields{“spouse_occ”} = “spouse_occ”;
$fields{“father”} = “father”;
$fields{“father_occ”} = “father_occ”;
$fields{“mother”} = “mother”;
$fields{“mother_occ”} = “mother_occ”;
$fields{“interest”} = “interest”;
$fields{“skills”} = “skills”;
$fields{“health”} = “health”;
$fields{“illness”} = “illness”;
$fields{“sss”} = “sss”;
$fields{“tin”} = “tin”;
$fields{“hs_school”} = “hs_school”;
$fields{“hs_years”} = “hs_years”;
$fields{“hs_awards”} = “hs_awards”;
$fields{“college_school”} = “college_school”;
$fields{“college_years”} = “college_years”;
$fields{“college_awards”} = “college_awards”;
$fields{“post_school”} = “post_school”;
$fields{“post_years”} = “post_years”;
$fields{“other_school”} = “other_school”;
$fields{“other_years”} = “other_years”;
$fields{“exam”} = “exam”;
$fields{“exam_date”} = “exam_date”;
$fields{“rating”} = “rating”;
$fields{“job1”} = “job1”;
$fields{“jobdate1”} = “jobdate1”;
$fields{“jobposition1”} = “jobposition1”;
$fields{“jobaddress1”} = “jobaddress1”;
$fields{“jobsalary1”} = “jobsalary1”;
$fields{“jobsupervisor1”} = “jobsupervisor1”;
$fields{“Jobdesc1”} = “Jobdesc1”;
$fields{“jobreason1”} = “jobreason1”;
$fields{“job2”} = “job2”;
$fields{“jobdate2”} = “jobdate2”;
$fields{“jobposition2”} = “jobposition2”;
$fields{“jobaddress2”} = “jobaddress2”;
$fields{“jobsalary2”} = “jobsalary2”;
$fields{“jobsupervisor2”} = “jobsupervisor2”;
$fields{“Jobdesc2”} = “Jobdesc2”;
$fields{“jobreason2”} = “jobreason2”;
$fields{“refname1”} = “refname1”;
$fields{“refoccup1”} = “refoccup1”;
$fields{“ref_relation1”} = “ref_relation1”;
$fields{“ref_address1”} = “ref_address1”;
$fields{“ref_contact1”} = “ref_contact1”;
$fields{“refname2”} = “refname2”;
$fields{“refoccup2”} = “refoccup2”;
$fields{“ref_relation2”} = “ref_relation2”;
$fields{“ref_address2”} = “ref_address2”;
$fields{“ref_contact2”} = “ref_contact2”;
$fields{“salary_desired”} = “salary_desired”;
$fields{“salary_nego”} = “salary_nego”;
$fields{“start_date”} = “start_date”;
$fields{“cv_text”} = “cv_text”;
$fields{“cover_letter”} = “cover_letter”;

$body = “We have received the following information:nn”; foreach($fields as $a => $b){ $body .= sprintf("%20s: %sn",$b,$_REQUEST[$a]); }

$headers2 = “From: [email protected]”;
$subject2 = “Thank you for contacting us”;
$autoreply = "Thank you for your application to VIAP INC. (Versar International Assistance Projects). The company has established itself as the leading construction management and engineering services firm in conflict/post-conflict regions. Leveraging technology with a global reach, VIAP provides a cost-effective means of ensuring contract compliance, construction quality, and delivery of projects under the toughest of conditions.

Please forward your most comprehensive resume to [email protected]; [email protected] . We will review your profile carefully to match our urgent job opportunities here in Manila, Philippines. We will touch base with you again through e-mail or phone if there is any further information required from your end.

If you do not hear from us within a reasonable time frame, please accept our apologies for being unable to help you at this point of time. However, we will retain your resume in our database and will contact you again if there is any suitable job opportunity arises in the future.

If you also have friends who are interested in applying to any of our job requirements, please do not hesitate to give them our email address.

Meanwhile, we thank you for the interest you have shown in our company.

Wish you Good Luck!

Best regards,

Human Resources Department

if($from == ‘’) {print “You have not entered an email, please go back and try again”;}
else {
if($name == ‘’) {print “You have not entered a name, please go back and try again”;}
else {
$send = mail($to, $subject, $body, $headers);
$send2 = mail($from, $subject2, $autoreply, $headers2);
{header( “Location:” );}
{print “We encountered an error sending your mail, please notify [email protected]”; }
?> [/code]

If I try to put gmail or yahoo on the email on the application form I get errors but if I put “[email protected] .org or any *” the code works do you guys have any idea?

here is the link of the application form thank you very much for your help


It sounds like a smtp relaying problem.
Try this:
open a cmd window
and type the following :

telnet 25
rcpt to:[email protected]

Your SMTP server will tell you what is the problem !

Sorry for my poor english.

Sponsor our Newsletter | Privacy Policy | Terms of Service