Jump to content

[SOLVED] PHP code is not working in IE7 or Opera


bebelushu

Recommended Posts

Hello.

I have just started to learn PHP from a HF book and i'm trying to make this registration-form work. It's working perfectly on Firefox-it's sending the email and enters all the data in the database, but on Internet explorer of Opera it doesn't validate the data, doesn't send the email and doesn't enter the data in the database. If anyone can help me with this i will be very grateful .

Please find attached the code:

 

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Nanny au pair,family uk,aupairs</title>
<meta name="Description" content="Uk family registration form, so we can find you an au pair nanny or just au pairs" />
<meta name="Keywords" content="Nanny au pair,family uk,aupairs" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<link rel="shortcut icon" href="../favico.ico" />
<link href="../style.css" rel="stylesheet" type="text/css" />
<script type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>

</head>

<body onload="MM_preloadImages('../images/about2.gif','../images/calendar2.gif','../images/curriculum2.gif','../images/classes2.gif','../images/registration2.gif','../images/contacts2.gif','../images/home-button2.gif','../images/parent-involvement2.gif','../images/brochure2.gif')">

<div id="wrapper">

  <div id="header"><a href="../index.html" title="Nanny au pair,family uk,aupairs"></a> <a href="../index.html"><img src="../images/logo.png" alt="Nanny au pair,family uk,aupairs" border="0" /></a>
  <div class="right" id="topButtons"><a href="../index.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image25','','../images/home-button2.gif',1)"><img src="../images/home-button1.gif" alt="Nanny au pair,family uk,aupairs" name="Image25" width="44" height="44" border="0" /></a><a href="family-registration.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image26','','../images/parent-involvement2.gif',1)"><img src="../images/parent-involvement1.gif" alt="Nanny au pair,family uk,aupairs" name="Image26" width="44" height="44" border="0" /></a><a href="../aupair-registration.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image27','','../images/brochure2.gif',1)"><img src="../images/brochure1.gif" alt="au pair register" name="Image27" width="44" height="44" border="0" /></a></div>
</div><!--END HEADER-->

<div id="topNav"><a href="../index.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image19','','../images/calendar2.gif',1)"><img src="../images/calendar1.gif" alt="calendar" name="Image19" width="115" height="37" border="0" class="rtBorder" /></a><a href="../au-pair-agency/about.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image16','','../images/about2.gif',1)"><img src="../images/about1.gif" alt="about " name="Image16" width="115" height="37" border="0" class="rtBorder" /></a><a href="../au-pair-nanny/family.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image20','','../images/curriculum1.gif',1)"><img src="../images/curriculum2.gif" alt="curriculum" name="Image20" width="115" height="37" border="0" class="rtBorder" /></a><a href="../au-pair-london/aupair.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image21','','../images/classes2.gif',1)"><img src="../images/classes1.gif" alt="classes" name="Image21" width="115" height="37" border="0" class="rtBorder" /></a><a href="../terms.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image23','','../images/registration2.gif',1)"><img src="../images/registration1.gif" alt="resitration" name="Image23" width="115" height="37" border="0" class="rtBorder" /></a><a href="../contact.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image24','','../images/contacts2.gif',1)"><img src="../images/contacts1.gif" alt="contact" name="Image24" width="115" height="37" border="0" /></a></div>

<div class="interiorBanner"><img src="../images/family-title.jpg" alt="main banner" width="700" height="120" /></div>


<div class="mainBg">

<div class="interiorBox">
<div class="contactBox2">

<fieldset>
                    

<?php
  if (isset($_POST['submit'])) {
  $title = $_POST['title'];
  $name = $_POST['name'];
  $surname = $_POST['surname'];
  $address = $_POST['address'];
  $postcode = $_POST['postcode'];
  $phone = $_POST['phone'];
  $mobile = $_POST['mobile'];
  $email = $_POST['email'];
  $mocupation = $_POST['mocupation'];
  $focupation = $_POST['focupation'];
  $mnationality = $_POST['mnationality'];
  $fnationality = $_POST['fnationality'];
  $practiceit = $_POST['practiceit'];
  $freligion = $_POST['freligion'];
  $language = $_POST['language'];
  $childna = $_POST['childna'];
  $disabledm = $_POST['disabledm'];
  $disabledma = $_POST['disabledma'];
  $babye = $_POST['babye'];
  $singlep = $_POST['singlep'];
  $pets = $_POST['pets'];
  $anyhelp = $_POST['anyhelp'];
  $vegetarian = $_POST['vegetarian'];
  $smoke = $_POST['smoke'];
  $interests = $_POST['interests'];
  $share = $_POST['share'];
  $reference = $_POST['reference'];
  $aupair = $_POST['aupair'];
  $natpreference = $_POST['natpreference'];
  $natspecification = $_POST['natspecification'];
  $englishlevel = $_POST['englishlevel'];
  $aupairgender = $_POST['aupairgender'];
  $driver = $_POST['driver'];
  $car = $_POST['car'];
  $smoker = $_POST['smoker'];
  $vegaupair = $_POST['vegaupair'];
  $duration = $_POST['duration'];
  $weekhrs = $_POST['weekhrs'];
  $money = $_POST['money'];
  $engcourses = $_POST['engcourses'];
  $choirs = $_POST['choirs'];
  $start = $_POST['start'];
  $hadaupair = $_POST['hadaupair'];
  $comments = $_POST['comments'];
  $homespec = $_POST['homespec'];
  $aupairroom = $_POST['aupairroom'];
  $amenities = $_POST['amenities'];
  $agree = $_POST['agree'];


  
    
    
    $output_form = false;

    if (empty($name)) {
      // We know both $subject AND $text are blank 
      echo '<b style="font-weight:bold;color:red"> Please type in your name.</b><br />';
      $output_form = true;
    }

    if (empty($surname)) {
      echo '<b style="font-weight:bold;color:red">Please type in your surname.</b><br />';
      $output_form = true;
    }
    if (empty($address)) {
      // We know both $subject AND $text are blank 
      echo '<b style="font-weight:bold;color:red">Please type in your address.</b><br />';
      $output_form = true;
    }
    if (empty($postcode)) {
      // We know both $subject AND $text are blank 
      echo '<b style="font-weight:bold;color:red">Please type in your postcode.</b><br />';
      $output_form = true;
    }
    if (empty($phone)) {
      // We know both $subject AND $text are blank 
      echo '<b style="font-weight:bold;color:red">Please type in your phone number.</b><br />';
      $output_form = true;
    }
    if (empty($email)) {
      // We know both $subject AND $text are blank 
      echo '<b style="font-weight:bold;color:red">Please type in your email.</b><br />';
      $output_form = true;
    }
    if (empty($mocupation)) {
      // We know both $subject AND $text are blank 
      echo '<b style="font-weight:bold;color:red">Please type in the mother\'s occupation.</b><br />';
      $output_form = true;
    }
    if (empty($focupation)) {
      // We know both $subject AND $text are blank 
      echo '<b style="font-weight:bold;color:red">Please type in the father\'s occupation.</b><br />';
      $output_form = true;
    }
    if (empty($mnationality)) {
      // We know both $subject AND $text are blank 
      echo '<b style="font-weight:bold;color:red">Please type in the mother\'s nationality.</b><br />';
      $output_form = true;
    }
    if (empty($fnationality)) {
      // We know both $subject AND $text are blank 
      echo '<b style="font-weight:bold;color:red">Please type in the father\'s nationality.</b><br />';
      $output_form = true;
    }
    if (empty($freligion)) {
      // We know both $subject AND $text are blank 
      echo '<b style="font-weight:bold;color:red">Please type in the family religion.</b><br />';
      $output_form = true;
    }
    if (empty($language)) {
      // We know both $subject AND $text are blank 
      echo '<b style="font-weight:bold;color:red">Please type in the family language.</b><br />';
      $output_form = true;
    }
    if (empty($childna)) {
      // We know both $subject AND $text are blank 
       echo '<b style="font-weight:bold;color:red"> Please type in the children\'s names and ages.</b><br />';
      $output_form = true;
    }
    if (empty($reference)) {
      // We know both $subject AND $text are blank 
      echo '<b style="font-weight:bold;color:red">Please provide name,relationship,phone and email address of one referee.</b><br />';
      $output_form = true;
    }
    if (empty($duration)) {
      // We know both $subject AND $text are blank 
      echo '<b style="font-weight:bold;color:red">Please type in the duration of stay.</b><br />';
      $output_form = true;
    }
    if (empty($weekhrs)) {
      // We know both $subject AND $text are blank 
      echo '<b style="font-weight:bold;color:red">Please provide how many hours per week are required.</b><br />';
      $output_form = true;
    }
    if (empty($money)) {
      // We know both $subject AND $text are blank 
      echo '<b style="font-weight:bold;color:red">Please type in the poket money.</b><br />';
      $output_form = true;
    }
    if (empty($start)) {
      // We know both $subject AND $text are blank 
      echo '<b style="font-weight:bold;color:red">Please tell us when would you like the aupair to start.</b><br />';
      $output_form = true;
    }
    if (empty($homespec)) {
      // We know both $subject AND $text are blank 
      echo '<b style="font-weight:bold;color:red">Please describe your home.</b><br />';
      $output_form = true;
    }
    if (empty($aupairroom)) {
      // We know both $subject AND $text are blank 
      echo '<b style="font-weight:bold;color:red">Please describe the au pair\'s accommodation.</b><br />';
      $output_form = true;
    }
    if (empty($amenities)) {
      // We know both $subject AND $text are blank 
      echo '<b style="font-weight:bold;color:red">Please describe the area where you live.</b><br />';
      $output_form = true;
    }
    if (empty($agree)) {
      // We know both $subject AND $text are blank 
      echo '<b style="font-weight:bold;color:red">Please tick the "I agree" box at the bottom of the form.</b><br />';
      $output_form = true;
    }
    

   else {
    $output_form = true;
    
     $dbc = mysqli_connect('', '', '', '')
    or die('Error connecting to MySQL server.');

  $query = "INSERT INTO tableName (title, name, surname, address, phone, mobile, email, mocupation, focupation,".
  "mnationality, fnationality, freligion, practiceit, language, childna, disabledm, disabledma, babye, singlep,".
  "pets, anyhelp, vegetarian, smoke, interests, share, reference, aupair, natpreference, natspecification, englishlevel,".
  "aupairgender, driver, car, smoker, vegaupair, duration, weekhrs, money, engcourses, choirs, start, hadaupair,".
  "comments, homespec, aupairroom, amenities, agree)".
    "VALUES ('$title', '$name', '$surname', '$address', '$phone', '$mobile', '$email', '$mocupation', '$focupation', ".
  "'$mnationality', '$fnationality', '$freligion', '$practiceit', '$language', '$childna', '$disabledm', '$disabledma', '$babye', '$singlep', ".
  "'$pets', '$anyhelp', '$vegetarian', '$smoke', '$interests', '$share', '$reference', '$aupair', '$natpreference', '$natspecification', '$englishlevel', ".
  "'$aupairgender', '$driver', '$car', '$smoker', '$vegaupair', '$duration', '$weekhrs', '$money', '$engcourses', '$choirs', '$start', '$hadaupair', ".
  "'$comments', '$homespec', '$aupairroom', '$amenities', '$agree')";


  $result = mysqli_query($dbc, $query)
    or die('Error querying database.');

  

  mysqli_close($dbc);
  }
}
if (!empty($name) && !empty($surname) && !empty($address) && !empty($phone) && !empty($email) && !empty($mocupation) && !empty($focupation) &&
    !empty($mnationality) && !empty($fnationality) && !empty($freligion) &&
    !empty($language) && !empty($childna) && !empty($reference) && !empty($duration) && !empty($weekhrs) &&
    !empty($money) && !empty($start) && !empty($homespec) && !empty($aupairroom) && !empty($amenities) && !empty($agree)){
    echo '<p id="thanks">Thank you for registering with us!</p>';
    
     $to = 'registration-info@aupairss.co.uk';
  $subject = 'Aupairss.co.uk - New family';
  $msg = "New family registered ! \n\n Name: $name \n Surname: $surname \n Address: $address \n Children's names and ages: $childna \n Needs an au pair for: $duration \n To work $weekhrs hours per week \n Pocket money: £$money per week";
  mail($to, $subject, $msg, 'From:' . $email);
  
    }else{
    ?>
    <form method="post" action="<?php echo $_SERVER['../PHP_SELF']; ?>">
    <p class="formro">Family registration form</p><br />
<table id="first">
     <tr>
     <td><label for="title">  Title:</label></td>
      <td><select id="title" name="title">
        <option value="mr" <?php if (!empty($mr) && $title == 'mr') echo 'selected = "selected"'; ?>>Mr</option>
        <option value="mrs" <?php if (!empty($mrs) && $title == 'mrs') echo 'selected = "selected"'; ?>>Mrs</option>
        <option value="ms" <?php if (!empty($ms) && $title == 'ms') echo 'selected = "selected"'; ?>>Ms</option>
      </select><br /></td></tr>

    <tr>
    <td><span class="style1">*</span><label for="name">First name:</label></td>
    <td><input type="text" id="name" name="name" value="<?php echo $name; ?>" />    </td></tr>
    
    <tr>
      <td><span class="style1">*</span><label for="surname">Surname:</label></td>
    <td><input type="text" id="surname" name="surname" value="<?php   echo $surname; ?>" />    </td></tr>
    
    <tr>
      <td><span class="style1">*</span><label for="address">Address:</label><br /></td>
    <td><textarea  id="address" name="address"  rows="6" cols="30"><?php  echo $address; ?></textarea></td></tr>
   
   <tr>
    <td><span class="style1">*</span><label for="postcode">Postcode:</label></td>
    <td><input type="text" id="postcode" name="postcode" value="<?php echo $postcode; ?>" /></td></tr>
    
    <tr>
    <td><span class="style1">*</span><label for="phone">Tel number:</label></td>
    <td><input type="text" id="phone" name="phone" value="<?php  echo $phone; ?>" />    </td></tr>
    
    <tr>
        <td><label for="mobile">  Mobile:</label></td>
    <td><input type="text" id="mobile" name="mobile" value="<?php  echo $mobile; ?>" /></td></tr>
  
  <tr>
    <td><span class="style1">*</span><label for="email">Email:</label></td>
    <td><input type="text" id="email" name="email" value="<?php  echo $email; ?>" /></td></tr>
    </table>
    
    <br /><br />
        <p class="formtitle">Please provide the following personal information: </p><hr />
    <table id="second">
    <tr>
    <td><span class="style1">*</span><label for="mocupation">Mother’s occupation:</label></td>
    <td><input type="text" id="mocupation" name="mocupation" value="<?php  echo $mocupation; ?>" />    </td></tr>
    
    <tr>
    <td><span class="style1">*</span><label for="focupation">Father’s occupation:</label></td>
    <td><input type="text" id="focupation" name="focupation" value="<?php  echo $focupation; ?>" />    </td></tr>
    
    <tr>
    <td><span class="style1">*</span><label for="mnationality">Mother’s nationality:</label></td>
    <td><input type="text" id="mnationality" name="mnationality" value="<?php  echo $mnationality; ?>" />    </td></tr>
    
    <tr>
    <td><span class="style1">*</span><label for="fnationality">Father’s nationality:</label></td>
    <td><input type="text" id="fnationality" name="fnationality" value="<?php  echo $fnationality; ?>" />    </td></tr>
    
    <tr>
    <td><span class="style1">*</span><label for="freligion">Family’s religion:</label></td>
    <td><input type="text" id="freligion" name="freligion" value="<?php  echo $freligion; ?>" />    </td></tr>
    
    <tr>
    <td>  <label for="practiceit">Do you practice it:</label></td>
      <td><select id="practiceit" name="practiceit">
        <option value="yes" <?php if (!empty($practiceit) && $practiceit == 'yes') echo 'selected = "selected"'; ?>>Yes</option>
        <option value="no" <?php if (!empty($practiceit) && $practiceit == 'no') echo 'selected = "selected"'; ?>>No</option>
      </select></td></tr>
      
      <tr>
    <td><span class="style1">*</span><label for="language">Spoken language in family home:</label></td>
    <td><input type="text" id="language" name="language" value="<?php  echo $language; ?>" />    </td></tr>
    
    <tr>
    <td><span class="style1">*</span><label for="childna">Children’s names and ages:</label></td>
    <td><textarea  id="childna" name="childna"  rows="6" cols="30"><?php  echo $childna; ?></textarea></td></tr>
    
    <tr>
    <td><label for="disabledm">Are any of the family members disabled:</label></td>
      <td><select id="disabledm" name="disabledm">
        <option value="yes" <?php if (!empty($disabledm) && $disabledm == 'yes') echo 'selected = "selected"'; ?>>Yes</option>
        <option value="no" <?php if (!empty($disabledm) && $disabledm == 'no') echo 'selected = "selected"'; ?>>No</option>
      </select></td></tr>
      
      <tr>
      <td><label for="disabledma">If yes please specify:</label></td>
    <td><textarea  id="disabledma" name="disabledma"  rows="6" cols="30"><?php  echo $address; ?></textarea></td></tr>
     
     <tr>
     <td><label for="babye">Is a baby expected?</label></td>
      <td><select id="babye" name="babye">
        <option value="yes" <?php if (!empty($babyer) && $babye == 'yes') echo 'selected = "selected"'; ?>>Yes</option>
        <option value="no" <?php if (!empty($babye) && $babye == 'no') echo 'selected = "selected"'; ?>>No</option>
      </select></td></tr>
      
      <tr>
      <td><label for="singlep">Are you a single parent ?</label></td>
    <td><select id="singlep" name="singlep">
        <option value="yes" <?php if (!empty($singlep) && $singlep == 'yes') echo 'selected = "selected"'; ?>>Yes</option>
        <option value="no" <?php if (!empty($singlep) && $singlep == 'no') echo 'selected = "selected"'; ?>>No</option>
      </select></td></tr>
      
      <tr> 
        <td><label for="pets">Do you have pets? If yes please specify:</label></td>
    <td><textarea  id="pets" name="pets"  rows="6" cols="30"><?php echo $pets; ?></textarea></td></tr>
    
   <tr>
    <td><label for="anyhelp">Do you have any other help (gardener, cleaner, family help)?<br /> please specify:</label></td>
    <td><textarea  id="anyhelp" name="anyhelp"  rows="6" cols="30"><?php  echo $anyhelp; ?></textarea></td></tr>
    
    <tr>
    <td><label for="vegetarian">Are you a vegetarian?</label></td>
      <td><select id="vegetarian" name="vegetarian">
        <option value="yes" <?php if (!empty($vegetarian) && $vegetarian == 'yes') echo 'selected = "selected"'; ?>>Yes</option>
        <option value="no" <?php if (!empty($vegetarian) && $vegetarian == 'no') echo 'selected = "selected"'; ?>>No</option>
      </select></td></tr>
      
      <tr>
      <td><label for="smoke">Do you smoke?</label></td>
      <td><select id="smoke" name="smoke">
        <option value="yes" <?php if (!empty($smoke) && $smoke == 'yes') echo 'selected = "selected"'; ?>>Yes</option>
        <option value="no" <?php if (!empty($smoke) && $smoke == 'no') echo 'selected = "selected"'; ?>>No</option>
        <option value="not_with_children" <?php if (!empty($smoke) && $smoke == 'not_with_children') echo 'selected = "selected"'; ?>>Not in the house or in front of children</option>
      </select></td></tr> 
      
      <tr>
      <td><label for="interests">Family interests:</label></td>
    <td><textarea  id="interests" name="interests"  rows="6" cols="30"><?php  echo $interests; ?></textarea></td></tr>
    
    <tr>
    <td><label for="share">Anything else you would like to share with us?</label></td>
    <td><textarea  id="share" name="share"  rows="6" cols="30"> <?php  echo $share; ?></textarea></td></tr>
    
    <tr>
    <td><span class="style1">*</span><label for="reference">Please provide one reference:</label></td>
    <td><textarea  id="reference" name="reference"  rows="6" cols="30"><?php  echo $reference; ?></textarea></td></tr></table><br /><br />

    
      <p class="formtitle">Family requirements </p><hr />
      
      
      <table id="third">
      <tr>
      <td><label for="aupair">What kink of au pair do you require?</label></td>
      <td><select id="aupair" name="aupair">
        <option value="aupairplus" <?php if (!empty($aupair) && $aupair == 'aupairplus') echo 'selected = "selected"'; ?>>Au Pair Plus (max. 40 h/week)</option>
        <option value="aupaircouple" <?php if (!empty($aupair) && $aupair == 'aupaircouple') echo 'selected = "selected"'; ?>>Au Pair Couple</option>
        <option value="au_pair" <?php if (!empty($aupair) && $aupair == 'au_pair') echo 'selected = "selected"'; ?>>Au Pair (25 h/week)</option>
      </select></td></tr>
    
    <tr>
    <td><label for="natpreference">Any preference on nationality</label></td>
      <td><select id="natpreference" name="natpreference">
        <option value="yes" <?php if (!empty($natpreference) && $natpreference == 'yes') echo 'selected = "selected"'; ?>>Yes</option>
        <option value="no" <?php if (!empty($natpreference) && $vnatpreference == 'no') echo 'selected = "selected"'; ?>>No</option>
      </select></td></tr>
      
      <tr>
      <td><label for="natspecification">Please specify:</label></td>
    <td><input type="text" id="natspecification" name="natspecification" value="<?php echo $natspecification; ?>" /></td></tr>
    
    <tr>
    <td><label for="englishlevel">Level of English</label></td>
      <td><select id="englishlevel" name="englishlevel">
        <option value="any" <?php if (!empty($englishlevel) && $englishlevel == 'any') echo 'selected = "selected"'; ?>>Any</option>
        <option value="basic" <?php if (!empty($natpreference) && $englishlevel == 'basic') echo 'selected = "selected"'; ?>>Basic</option>
         <option value="medium" <?php if (!empty($englishlevel) && $englishlevel == 'medium') echo 'selected = "selected"'; ?>>Medium</option>
          <option value="fluent" <?php if (!empty($englishlevel) && $englishlevel == 'fluent') echo 'selected = "selected"'; ?>>Fluent</option>
      </select></td></tr>
      
      <tr>
       <td><label for="aupairgender">Preferred gender of the au pair:</label></td>
      <td><select id="aupairgender" name="aupairgender">
        <option value="any" <?php if (!empty($aupairgender) && $aupairgender == 'any') echo 'selected = "selected"'; ?>>Any</option>
        <option value="male" <?php if (!empty($aupairgender) && $aupairgender == 'male') echo 'selected = "selected"'; ?>>Male</option>
         <option value="female" <?php if (!empty($aupairgender) && $aupairgender == 'female') echo 'selected = "selected"'; ?>>Female</option>
      </select></td></tr>
      
       <tr>
       <td><label for="driver">Do you require a driver?</label></td>
      <td><select id="driver" name="driver">
        <option value="any" <?php if (!empty($driver) && $driver == 'any') echo 'selected = "selected"'; ?>>Any</option>
        <option value="yes" <?php if (!empty($driver) && $driver == 'yes') echo 'selected = "selected"'; ?>>Yes</option>
         <option value="no" <?php if (!empty($driver) && $driver == 'no') echo 'selected = "selected"'; ?>>No</option>
      </select></td></tr>
      
      <tr>
      <td><label for="car">Do you provide a car?</label></td>
      <td><select id="car" name="car">
        <option value="yes" <?php if (!empty($car) && $car == 'yes') echo 'selected = "selected"'; ?>>Yes</option>
        <option value="no" <?php if (!empty($car) && $car == 'no') echo 'selected = "selected"'; ?>>No</option>
         <option value="onlyjob" <?php if (!empty($car) && $car == 'onlyjob') echo 'selected = "selected"'; ?>>Only for job related use</option>
      </select></td></tr>
      
      <tr>
       <td><label for="smoker">Would you consider a smoker?</label></td>
      <td><select id="smoker" name="smoker">
        <option value="yes" <?php if (!empty($smoker) && $smoker == 'yes') echo 'selected = "selected"'; ?>>Yes</option>
        <option value="no" <?php if (!empty($smoker) && $smoker == 'no') echo 'selected = "selected"'; ?>>No</option>
         <option value="not_in_the_house" <?php if (!empty($smoker) && $smoker == 'not_in_the_house') echo 'selected = "selected"'; ?>>Not in front of the children or in the house</option>
         <option value="Any" <?php if (!empty($smoker) && $smoker == 'any') echo 'selected = "selected"'; ?>>Any</option>
      </select></td></tr>
      
      <tr>
       <td><label for="vegaupair">Would you accept a vegetarian au pair?</label></td>
      <td><select id="vegaupair" name="vegaupair">
        <option value="yes" <?php if (!empty($vegaupair) && $vegaupair == 'yes') echo 'selected = "selected"'; ?>>Yes</option>
         <option value="no" <?php if (!empty($vegaupair) && $vegaupair == 'no') echo 'selected = "selected"'; ?>>No</option>
      </select></td></tr>
      
      <tr>
        <td><span class="style1">*</span><label for="duration">Duration of stay:</label></td>
    <td><input type="text" id="duration" name="duration" value="<?php echo $duration; ?>" /></td></tr>
    
    <tr>
    <td><label for="weekhrs"><span class="style1">*</span>How many hours per week?</label></td>
    <td><input type="text" id="weekhrs" name="weekhrs" value="<?php echo $weekhrs; ?>" /></td></tr>
    
    <tr>
    <td><span class="style1">*</span><label for="money"> Pocket money:</label></td>
    <td><input type="text" id="money" name="money" value="<?php echo $money; ?>" /></td></tr>
    
    <tr>
    <td><label for="engcourses">Would you be happy to contribute towards English classes costs?</label></td>
      <td><select id="engcourses" name="engcourses">
        <option value="yes" <?php if (!empty($engcourses) && $engcourses == 'yes') echo 'selected = "selected"'; ?>>Yes</option>
         <option value="no" <?php if (!empty($engcourses) && $engcourses == 'no') echo 'selected = "selected"'; ?>>No</option>
      </select></td></tr>
      
      <tr>
      <td><label for="choirs">Please specify the au pair's duties (light housework, washing/ironing, tidying, cooking, caring for pets,etc) :</label></td>
     <td> 
   <textarea  id="choirs" name="choirs"  rows="6" cols="30"><?php echo $choirs; ?></textarea></td></tr>
   
   <tr>
   <td><span class="style1">*</span><label for="start">When would you like the au pair to start?</label></td>
    <td><input type="text" id="start" name="start" value="<?php echo $start; ?>" /></td></tr>
    
    <tr>
    <td><label for="hadaupair">Have you ever had an au pair?</label></td>
      <td><select id="hadaupair" name="hadaupair">
        <option value="yes" <?php if (!empty($hadaupair) && $hadaupair == 'yes') echo 'selected = "selected"'; ?>>Yes</option>
         <option value="no" <?php if (!empty($hadaupair) && $hadaupair == 'no') echo 'selected = "selected"'; ?>>No</option>
      </select></td></tr>
      
      <tr>
        <td><label for="comments">Anything else you would like to share with the au pair?</label></td>
    <td><textarea  id="comments" name="comments"  rows="6" cols="30"><?php  echo $comments; ?></textarea></td></tr>
</table><br /><br />



<p class="formtitle">Please provide details of your home</p><hr />


<table id="fourth">

<tr>
<td><span class="style1">*</span> <label for="homespec">Please describe your home(how many bedrooms ,bathrooms, facilities):</label></td>
    <td><textarea  id="homespec" name="homespec"  rows="6" cols="30"><?php  echo $homespec; ?></textarea></td></tr>
    
    <tr>
    <td><span class="style1">*</span> <label for="aupairroom">Please describe the au pair’s accommodation(please include any facilities like Internet, use of computer, tv/dvd in their room, etc) :</label></td>
    <td><textarea  id="aupairroom" name="aupairroom"  rows="6" cols="30"><?php  echo $aupairroom; ?></textarea></td></tr>
    
    <tr>
    <td><span class="style1">*</span> <label for="amenities">Please describe the area where you live and any amenities:</label></td>
    <td><textarea  id="amenities" name="amenities"  rows="6" cols="30"><?php  echo $amenities; ?></textarea></td></tr>  

    <tr>
    <td><span class="style1">*</span> <input name="agree" type="checkbox" value=" <?php  echo 'agreed'; ?>" />
      I have read and agreed to the <a href="../terms.html" target="_blank">Terms & Conditions</a> of business.</td>
    <td> </td></tr>
    
    <tr>
    <td><br /><input name="submit" type="image" value="Send" src="../images/submit-button.gif" /></td>
    <td> </td></tr>
    </table>
    </form>
    <?php
    }
    ?>
    </fieldset>

    </div>
<br />
<br />

</div><!--END BOX-->
</div><!--END MAIN SECTION-->


<div id="footer">
    <a href="../index.html">Home</a>    
    <a href="../au-pair-agency/about.html">About Us </a>  
    <a href="../family.html">Family</a>  
    <a href="../aupair.html">Au Pair </a>   
    <a href="../terms.html">Terms & Fees </a>  
    <a href="../aupair-registration.php">Au Pair Registration  </a>  
    <a href="family-registration.php">Family Registration </a>  
    <a href="http://blog.aupairss.co.uk/#home" target="_blank">Au Pair Blog </a>   
    <a href="../contact.php">Contacts</a></div>
<!--END FOOTER-->
</div><!--END BODY WRAPPER-->
</body>
</html>


 

I struggled with this more than a week, Any ideas are welcome.

Many thanks

Val

Link to comment
Share on other sites

Or: 

 

if($_POST['submit'] == "Send")

 

should work too.

 

that won't work any better then the original code. in the past i've found some browsers don't sent the button, especially if it's not physically clicked. so, i've trained myself to just use the REQUEST_METHOD, which is set by PHP, therefore consistent

Link to comment
Share on other sites

Or: 

 

if($_POST['submit'] == "Send")

 

should work too.

 

that won't work any better then the original code. in the past i've found some browsers don't sent the button, especially if it's not physically clicked. so, i've trained myself to just use the REQUEST_METHOD, which is set by PHP, therefore consistent

 

I see, thanks for that rhodesa, hadn't realised that - always worth learning something new.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.