Hello Everyone,

I don't understand why my code won't work. Everything LOOKS fine, but I don't get the email I'm supposed to get and the screen does not refresh with the thank you message the user should see once the submit button has been pressed. Below is my code (the whole page). THanks in advance for all your help.

<!DOCTYPE HTML>
<html>
<head>
<style>
li {list-style:none}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="INCE, International Nusring Education COnsortium, nursing, study abroad, dominican republic, haiti, dr. mildred fennal, mildred fennal">
<meta name="description" content="INEC is Nurses preparing to serve a global society through study abroad">
<title>INEC...International Nursing Education Consortium</title>
<link href="inec.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
<!--
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_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_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>
<link href="SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css">
<link href="form.css" rel="stylesheet" type="text/css" media="all">
</head>
<body onLoad="MM_preloadImages('images/button-hover.png')">
<div id="header">
<div id="left"> <a href="index.php"><img src="images/INEC-logo.png" width="118" height="97"></a>
<div>Nurses preparing to serve a global society through study abroad</div>
</div>
<div id="inec">
<div>International Nursing Education Consortium</div>
<a href="inec-study-abroad.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('study abroad button','','images/button-hover.png',1)"><img src="images/button.png" alt="press to study abroad with inec" name="study abroad button" width="108" height="28" border="0"></a> </div>
</div>
<div class="clear"></div>
<div class="menubar">
<?php include 'menu.html'; ?>
</div>
<div class="bigbox" style="margin-left:10%;
    width:35%;">
<h3>Join Us</h3>
<p>Types of Membership</p>
<ul>
<li>* Individual</li>
<li>* Group</li>
<li>* School of Nursing</li>
<li>* University</li>
<li>* Organization</li>
</ul>
<p>Joining the consortium is very simple. If you are an individual who would like to volunteer to work in a hospital, clinic, or the community, simply use the contact information and e-mail or call to receive an application.</p>

<p>If you are a graduate student completing research or clinical hours, call or e-mail for details of the program.
</p>
<p>If you are a school of nursing that understand the importance of a program such as this, do likewise. The Director will be happy to travel to your school to meet with faculty and others to present more detailed information on how the program works.</p>
<p>The International Nursing Education Consortium<br>
5501 Hampton Woods Way<br>
Tallahassee, FL 32311<br>
(850)385-1042<br>
Fax(850)385-8895<br>
 inncons@aol.com</p>
</div>
<div class="sidebar" style="width:35%">
<?php
if (isset($_POST['submit']))
{
$to = "dmiller@mtechenterprises.com";
$subject = "INEC Registration/Application";
$message = "From: ";
$message .= $_POST['title'] . "\n";
$message .= $_POST['name'] . "\n";
$message .= $_POST['address1'] . "\n";
$message .= $_POST['address2'] . "\n";
$message .= $_POST['city'] . "\n";
$message .= $_POST['state'] . "\n";
$message .= $_POST['country'] . "\n";
$message .= $_POST['phone'] . "\n";
$message .= $_POST['email'] . "\n";
$message .= $_POST['membership'] . "\n";
$message .= $_POST['feedback'];

mail ($to, $subject, $message);

echo "<p style='text-align:center;color:#006; font-family: Arial, Helvetica, sans-serif; font-weight:bold; margin-right:15px'> Thank you for registering<br/> Someone will respond in the next 48 hours.</p>";

}
else 
{   
?> 
<div class="box">
    <form  method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
          <label class="input_text">
          <span>Title:</span>
          <select name="title" title="title" id="title" class="input_text">
          <option value="Dr.">Dr.</option>
            <option value="Miss">Miss</option>
            <option value="Mr.">Mr.</option>
            <option value="Mrs.">Mrs.</option>
            <option value="Ms.">Ms.</option>
            <option value="Professor">Professor</option>
          </select>
          </label>
            <label class="input_text">
               <span>Full Name</span>
               <input name="name" type="text" class="input_text" id="name"/>
            </label>
            <label class="input_text">
            <span>Address1</span>
            <input  name="address1" id="address1" class="input_text">
            </label>
            <label class="input_text">
            <span>Address2</span>
            <input  name="address2" id="address2" class="input_text">
            </label>
            <label class="input_text">
            <span>City</span>
             <input name="city" type="text" id="city" class="input_text"/>
    </label>
             <label class="input_text">
            <span>State</span>
             <input name="state" type="text" id="state" class="input_text" />
             </label>
             <label class="input_text">
             <span>Country</span>
<select name="country" id="country" title="Home Country/Region" class="input_text">
    <option value="Afghanistan">Afghanistan</option>
    <option value="Albania">Albania</option>
    <option value="Algeria">Algeria</option>
    <option value="American Samoa">American Samoa</option>
    <option value="Andorra">Andorra</option>
    <option value="Angola">Angola</option>
    <option value="Anguilla">Anguilla</option>
    <option value="Antarctica">Antarctica</option>
    <option value="Antigua and Barbuda">Antigua and Barbuda</option>
    <option value="Argentina">Argentina</option>
    <option value="Armenia">Armenia</option>
    <option value="Aruba">Aruba</option>
    <option value="Australia">Australia</option>
    <option value="Austria">Austria</option>
    <option value="Azerbaijan">Azerbaijan</option>
    <option value="Bahamas, The">Bahamas, The</option>
    <option value="Bahrain">Bahrain</option>
    <option value="Baker Island">Baker Island</option>
    <option value="Bangladesh">Bangladesh</option>
    <option value="Barbados">Barbados</option>
    <option value="Belarus">Belarus</option>
    <option value="Belgium">Belgium</option>
    <option value="Belize">Belize</option>
    <option value="Benin">Benin</option>
    <option value="Bermuda">Bermuda</option>
    <option value="Bhutan">Bhutan</option>
    <option value="Bolivia">Bolivia</option>
    <option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option>
    <option value="Botswana">Botswana</option>
    <option value="Bouvet Island">Bouvet Island</option>
    <option value="Brazil">Brazil</option>
    <option value="British Indian Ocean Territory">British Indian Ocean Territory</option>
    <option value="Brunei">Brunei</option>
    <option value="Bulgaria">Bulgaria</option>
    <option value="Burkina Faso">Burkina Faso</option>
    <option value="Burundi">Burundi</option>
    <option value="Cambodia">Cambodia</option>
    <option value="Cameroon">Cameroon</option>
    <option value="Canada">Canada</option>
    <option value="Cape Verde">Cape Verde</option>
    <option value="Cayman Islands">Cayman Islands</option>
    <option value="Central African Republic">Central African Republic</option>
    <option value="Chad">Chad</option>
    <option value="Chile">Chile</option>
    <option value="China">China</option>
    <option value="Christmas Island">Christmas Island</option>
    <option value="Cocos (Keeling) Islands">Cocos (Keeling) Islands</option>
    <option value="Colombia">Colombia</option>
    <option value="Comoros">Comoros</option>
    <option value="Congo">Congo</option>
    <option value="Congo (DRC)">Congo (DRC)</option>
    <option value="Cook Islands">Cook Islands</option>
    <option value="Costa Rica">Costa Rica</option>
    <option value="Croatia">Croatia</option>
    <option value="Côte d’Ivoire">Côte d’Ivoire</option>
    <option value="Cuba">Cuba</option>
    <option value="Cyprus">Cyprus</option>
    <option value="Czech Republic">Czech Republic</option>
    <option value="Denmark">Denmark</option>
    <option value="Djibouti">Djibouti</option>
    <option value="Dominica">Dominica</option>
    <option value="Dominican Republic">Dominican Republic</option>
    <option value="Ecuador">Ecuador</option>
    <option value="Egypt">Egypt</option>
    <option value="El Salvador">El Salvador</option>
    <option value="Equatorial Guinea">Equatorial Guinea</option>
    <option value="Eritrea">Eritrea</option>
    <option value="Estonia">Estonia</option>
    <option value="Ethiopia">Ethiopia</option>
    <option value="Falkland Islands (Islas Malvinas)">Falkland Islands (Islas Malvinas)</option>
    <option value="Faroe Islands">Faroe Islands</option>
    <option value="Fiji Islands">Fiji Islands</option>
    <option value="Finland">Finland</option>
    <option value="France">France</option>
    <option value="French Guiana">French Guiana</option>
    <option value="French Polynesia">French Polynesia</option>
    <option value="French Southern and Antarctic Lands">French Southern and Antarctic Lands</option>
    <option value="Gabon">Gabon</option>
    <option value="Gambia, The">Gambia, The</option>
    <option value="Georgia">Georgia</option>
    <option value="Germany">Germany</option>
    <option value="Ghana">Ghana</option>
    <option value="Gibraltar">Gibraltar</option>
    <option value="Greece">Greece</option>
    <option value="Greenland">Greenland</option>
    <option value="Grenada">Grenada</option>
    <option value="Guadeloupe">Guadeloupe</option>
    <option value="Guam">Guam</option>
    <option value="Guatemala">Guatemala</option>
    <option value="Guernsey">Guernsey</option>
    <option value="Guinea">Guinea</option>
    <option value="Guinea-Bissau">Guinea-Bissau</option>
    <option value="Guyana">Guyana</option>
    <option value="Haiti">Haiti</option>
    <option value="Heard Island and McDonald Islands">Heard Island and McDonald Islands</option>
    <option value="Honduras">Honduras</option>
    <option value="Hong Kong SAR">Hong Kong SAR</option>
    <option value="Howland Island">Howland Island</option>
    <option value="Hungary">Hungary</option>
    <option value="Iceland">Iceland</option>
    <option value="India">India</option>
    <option value="Indonesia">Indonesia</option>
    <option value="Iran">Iran</option>
    <option value="Iraq">Iraq</option>
    <option value="Ireland">Ireland</option>
    <option value="Isle of Man">Isle of Man</option>
    <option value="Israel">Israel</option>
    <option value="Italy">Italy</option>
    <option value="Jamaica">Jamaica</option>
    <option value="Jan Mayen">Jan Mayen</option>
    <option value="Japan">Japan</option>
    <option value="Jarvis Island">Jarvis Island</option>
    <option value="Jersey">Jersey</option>
    <option value="Johnston Atoll">Johnston Atoll</option>
    <option value="Jordan">Jordan</option>
    <option value="Kazakhstan">Kazakhstan</option>
    <option value="Kenya">Kenya</option>
    <option value="Kingman Reef">Kingman Reef</option>
    <option value="Kiribati">Kiribati</option>
    <option value="Korea">Korea</option>
    <option value="Kuwait">Kuwait</option>
    <option value="Kyrgyzstan">Kyrgyzstan</option>
    <option value="Laos">Laos</option>
    <option value="Latvia">Latvia</option>
    <option value="Lebanon">Lebanon</option>
    <option value="Lesotho">Lesotho</option>
    <option value="Liberia">Liberia</option>
    <option value="Libya">Libya</option>
    <option value="Liechtenstein">Liechtenstein</option>
    <option value="Lithuania">Lithuania</option>
    <option value="Luxembourg">Luxembourg</option>
    <option value="Macao SAR">Macao SAR</option>
    <option value="Macedonia, Former Yugoslav Republic of">Macedonia, Former Yugoslav Republic of</option>
    <option value="Madagascar">Madagascar</option>
    <option value="Malawi">Malawi</option>
    <option value="Malaysia">Malaysia</option>
    <option value="Maldives">Maldives</option>
    <option value="Mali">Mali</option>
    <option value="Malta">Malta</option>
    <option value="Marshall Islands">Marshall Islands</option>
    <option value="Martinique">Martinique</option>
    <option value="Mauritania">Mauritania</option>
    <option value="Mauritius">Mauritius</option>
    <option value="Mayotte">Mayotte</option>
    <option value="Mexico">Mexico</option>
    <option value="Micronesia">Micronesia</option>
    <option value="Midway Islands">Midway Islands</option>
    <option value="Moldova">Moldova</option>
    <option value="Monaco">Monaco</option>
    <option value="Mongolia">Mongolia</option>
    <option value="Montenegro">Montenegro</option>
    <option value="Montserrat">Montserrat</option>
    <option value="Morocco">Morocco</option>
    <option value="Mozambique">Mozambique</option>
    <option value="Myanmar">Myanmar</option>
    <option value="Namibia">Namibia</option>
    <option value="Nauru">Nauru</option>
    <option value="Navassa Island">Navassa Island</option>
    <option value="Nepal">Nepal</option>
    <option value="Netherlands">Netherlands</option>
    <option value="Netherlands Antilles">Netherlands Antilles</option>
    <option value="New Caledonia">New Caledonia</option>
    <option value="New Zealand">New Zealand</option>
    <option value="Nicaragua">Nicaragua</option>
    <option value="Niger">Niger</option>
    <option value="Nigeria">Nigeria</option>
    <option value="Niue">Niue</option>
    <option value="Norfolk Island">Norfolk Island</option>
    <option value="North Korea">North Korea</option>
    <option value="Northern Mariana Islands">Northern Mariana Islands</option>
    <option value="Norway">Norway</option>
    <option value="Oman">Oman</option>
    <option value="Pakistan">Pakistan</option>
    <option value="Palau">Palau</option>
    <option value="Palestinian Authority">Palestinian Authority</option>
    <option value="Palmyra Atoll">Palmyra Atoll</option>
    <option value="Panama">Panama</option>
    <option value="Papua New Guinea">Papua New Guinea</option>
    <option value="Paraguay">Paraguay</option>
    <option value="Peru">Peru</option>
    <option value="Philippines">Philippines</option>
    <option value="Pitcairn Islands">Pitcairn Islands</option>
    <option value="Poland">Poland</option>
    <option value="Portugal">Portugal</option>
    <option value="Puerto Rico">Puerto Rico</option>
    <option value="Qatar">Qatar</option>
    <option value="Reunion">Reunion</option>
    <option value="Romania">Romania</option>
    <option value="Russia">Russia</option>
    <option value="Rwanda">Rwanda</option>
    <option value="Saint Helena">Saint Helena</option>
    <option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option>
    <option value="Saint Lucia">Saint Lucia</option>
    <option value="Saint Pierre and Miquelon">Saint Pierre and Miquelon</option>
    <option value="Saint Vincent and the Grenadines">Saint Vincent and the Grenadines</option>
    <option value="Samoa">Samoa</option>
    <option value="San Marino">San Marino</option>
    <option value="Saudi Arabia">Saudi Arabia</option>
    <option value="Senegal">Senegal</option>
    <option value="Serbia">Serbia</option>
    <option value="Seychelles">Seychelles</option>
    <option value="Sierra Leone">Sierra Leone</option>
    <option value="Singapore">Singapore</option>
    <option value="Slovakia">Slovakia</option>
    <option value="Slovenia">Slovenia</option>
    <option value="São Tomé and Príncipe">São Tomé and Príncipe</option>
    <option value="Solomon Islands">Solomon Islands</option>
    <option value="Somalia">Somalia</option>
    <option value="South Africa">South Africa</option>
    <option value="South Georgia and the South Sandwich Islands">South Georgia and the South Sandwich Islands</option>
    <option value="Spain">Spain</option>
    <option value="Sri Lanka">Sri Lanka</option>
    <option value="Sudan">Sudan</option>
    <option value="Suriname">Suriname</option>
    <option value="Svalbard and Jan Mayen Island">Svalbard and Jan Mayen Island</option>
    <option value="Swaziland">Swaziland</option>
    <option value="Sweden">Sweden</option>
    <option value="Switzerland">Switzerland</option>
    <option value="Syria">Syria</option>
    <option value="Taiwan">Taiwan</option>
    <option value="Tajikistan">Tajikistan</option>
    <option value="Tanzania">Tanzania</option>
    <option value="Thailand">Thailand</option>
    <option value="Timor-Leste">Timor-Leste</option>
    <option value="Togo">Togo</option>
    <option value="Tokelau">Tokelau</option>
    <option value="Tonga">Tonga</option>
    <option value="Trinidad and Tobago">Trinidad and Tobago</option>
    <option value="Tunisia">Tunisia</option>
    <option value="Turkey">Turkey</option>
    <option value="Turkmenistan">Turkmenistan</option>
    <option value="Turks and Caicos Islands">Turks and Caicos Islands</option>
    <option value="Tuvalu">Tuvalu</option>
    <option value="U.S. Minor Outlying Islands">U.S. Minor Outlying Islands</option>
    <option value="Uganda">Uganda</option>
    <option value="Ukraine">Ukraine</option>
    <option value="United Arab Emirates">United Arab Emirates</option>
    <option value="United Kingdom">United Kingdom</option>
    <option value="United States">United States</option>
    <option value="Uruguay">Uruguay</option>
    <option value="Uzbekistan">Uzbekistan</option>
    <option value="Vanuatu">Vanuatu</option>
    <option value="Vatican City">Vatican City</option>
    <option value="Venezuela">Venezuela</option>
    <option value="Vietnam">Vietnam</option>
    <option value="Virgin Islands, British">Virgin Islands, British</option>
    <option value="Virgin Islands, U.S.">Virgin Islands, U.S.</option>
    <option value="Wake Island">Wake Island</option>
    <option value="Wallis and Futuna">Wallis and Futuna</option>
    <option value="Yemen">Yemen</option>
    <option value="Zambia">Zambia</option>
    <option value="Zimbabwe">Zimbabwe</option>
</select>   
</label>        
           <label class="input_text">
               <span>Email</span>
               <input type="text" class="input_text" name="email" id="email"/>
    </label>
             <label class="input_text">
                <span>Phone</span>
                <input type="text" class="input_text" name="phone" id="phone"/>
            </label>
            <label class="input_text">
            <span>Membership</span>
            <select name="Membership" class="input_text" id="membership">
            <option>Individual</option>
            <option>Group</option>
            <option>School of Nursing</option>
            <option>University</option>
            <option>Organization</option>
            </select>
            </label>
            <label class="input_text">
                <span>Message</span>
              <textarea name="feedback" cols="50" rows="5" class="input_text" id="feedback">

Is hard to read your code. Its to long :)
Well, I noticed in <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">.
U should write : <form method="post" action="<? $_SERVER['PHP_SELF'] ?>" >. Try do not use echo.
and don't forget to change your SMTP in php.ini [mail function]
Let me know if its work!

Thanks, but I actually solved my problem. I was afraid the code might be too long but I wanted to post it all not knowing if there was PHP HTML miscommunication going on or not and there was. My button name was different from the name I had PHP looking for.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.