PHP Submit Form is not working

Discussion in 'Site Programming, Development and Design' started by Soulzz, Aug 29, 2011.

  1. Code for index.html (FORM Part)

    Code:
     	<FORM action="contact.php" method="post" NAME="Customer_Information" onSubmit="return checkF(this)">
           <table width="770" border="0" cellpadding="3" cellspacing="0" bgcolor=c9c9c9>
            <tr align="left" valign="top">
              <td align="left" valign="middle" class="sectionlightgreen" align="left">
    		  First Name:
            </td>
            <td align=right><input name="fname" type="text" STYLE="color:#121212;" style="border: 1px dashed #999999">
              </td>
              <td class="sectionlightgreen"> Last Name: </td>
    
              <td align=right><input name="lname" type="text" STYLE="color:#121212;" style="border: 1px dashed #999999">
              </td>
    		  <td class="sectionlightgreen"> Desired Location </td>
    
              <td ><SELECT size=1 name="state" style="font-size:11px; color:#212121;">
                  <!-- <OPTION value=Phoenix selected>Arizona, Phoenix -->
                  <OPTION value=costa>California, Costa Mesa
                  <OPTION value=monrovia>California, Monrovia
                  <OPTION value=redlands>California, Redlands
    			  <OPTION value=sacramento>California, Sacramento
                  <OPTION value=parsipanny>New Jersey, Whippany
    			  <OPTION value=elko>Nevada, Elko
                  <OPTION value=vegas>Nevada, Las Vegas
    			  <OPTION value=reno>Nevada, Reno
    			  <OPTION value=pennsylvania>Pennsylvania, State College
    			  </OPTION>
    			  </select>
              </td>
             
            </tr><tr>
              <td class="sectionlightgreen"> Address: </td>
    
              <td align=right><input name="Address" type="text" STYLE="color:#121212;" style="border: 1px dashed #999999">
              </td>
              <td class="sectionlightgreen"> City:</td>
              <td align=right><input name="City" type="text" STYLE="color:#121212;" style="border: 1px dashed #999999">
              </td>
              <td class="sectionlightgreen"> State:
                <SELECT size=1 name="state" style="font-size:11px; color:#212121;">
                  <OPTION value=AL selected>AL
                  <OPTION 
                  value=AK>AK
                  <OPTION value=AZ>AZ
                  <OPTION value=AR>AR
                  <OPTION 
                  value=CA>CA
                  <OPTION value=CO>CO
                  <OPTION value=CT>CT
                  <OPTION 
                  value=DE>DE
                  <OPTION value=DC>DC
                  <OPTION value=FL>FL
                  <OPTION 
                  value=GA>GA
                  <OPTION value=HI>HI
                  <OPTION value=ID>ID
                  <OPTION 
                  value=IL>IL
                  <OPTION value=IN>IN
                  <OPTION value=IA>IA
                  <OPTION 
                  value=KS>KS
                  <OPTION value=KY>KY
                  <OPTION value=LA>LA
                  <OPTION 
                  value=ME>ME
                  <OPTION value=MD>MD
                  <OPTION value=MA>MA
                  <OPTION 
                  value=MI>MI
                  <OPTION value=MN>MN
                  <OPTION value=MS>MS
                  <OPTION 
                  value=MO>MO
                  <OPTION value=MT>MT
                  <OPTION value=NE>NE
                  <OPTION 
                  value=NV selected>NV
                  <OPTION value=NH>NH
                  <OPTION value=NJ>NJ
                  <OPTION 
                  value=NM>NM
                  <OPTION value=NY>NY
                  <OPTION value=NC>NC
                  <OPTION 
                  value=ND>ND
                  <OPTION value=OH>OH
                  <OPTION value=OK>OK
                  <OPTION 
                  value=OR>OR
                  <OPTION value=PA>PA
                  <OPTION value=RI>RI
                  <OPTION 
                  value=SC>SC
                  <OPTION value=SD>SD
                  <OPTION value=TN>TN
                  <OPTION 
                  value=TX>TX
                  <OPTION value=UT>UT
                  <OPTION value=VT>VT
                  <OPTION 
                  value=VA>VA
                  <OPTION value=WA>WA
                  <OPTION value=WV>WV
                  <OPTION 
                  value=WI>WI
                  <OPTION value=WY>WY</OPTION>
    
                </SELECT>
              </td>
              <td  class="sectionlightgreen"> Zip:
                <input name="Zip" type="text" size=10 STYLE="color:#121212;" style="border: 1px dashed #999999">
              </td>
            </tr>
            <tr>
              <td class="sectionlightgreen"> Phone: </td>
    
              <td align=right><input name="Phone" type="text" STYLE="color:#121212;" style="border: 1px dashed #999999">
              </td>
              <td class="sectionlightgreen"> Alt/Cell: </td>
              <td align=right><input name="Altcell" type="text" STYLE="color:#121212;" style="border: 1px dashed #999999">
              </td>
              <td class="sectionlightgreen"> Email:</td>
              <td ><input name="email" type="text" STYLE="color:#121212;" style="border: 1px dashed #999999">
    
              </td>
            </tr>
            
              
              
              
              </td>
              
            
    		<tr valign="top" bgcolor="#cdcdcd">
    
    			
    		</tr>
            <tr valign="top">
              <td class="sectionlightgreen" align="left" colspan=2> Paste a description or resume: </td>
              <td align=left colspan=4><textarea name="Comments" style="font-size:11px; color:#212121; width:500" cols="80" rows="2"></textarea>
              </td>
            </tr>
            <tr bgcolor="#cdcdcd">
    
              
            </tr>
            <tr bgcolor="#cdcdcd">
             
            </tr>
            <tr valign=top>
              <td class="sectionlightgreen" colspan=3 align=left><SCRIPT LANGUAGE = 'JavaScript'><!--
    function makeArray() {
        for (i = 0; i<makeArray.arguments.length; i++)
            this[i + 1] = makeArray.arguments[i];
    }
    
    function makeArray0() {
        for (i = 0; i<makeArray0.arguments.length; i++)
            this[i] = makeArray0.arguments[i];
    }
    
    function y2k(number) { return (number < 1000) ? number + 1900 : number; }
    
    var months = new makeArray('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
    var days = new makeArray0('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
    
    var today = new Date();
    var day   = days[today.getDay()];
    var date  = today.getDate();
    var month = today.getMonth() + 1;
    var year  = y2k(today.getYear());
    
    document.write(day + ', ' + months[month] + '  ' + date + '  ' + year);
    //--></SCRIPT>
                 
                <script>
    <!--
    
    
    function show2(){
    if (!document.all&&!document.getElementById)
    return
    thelement=document.getElementById? document.getElementById("tick2"): document.all.tick2
    var Digital=new Date()
    var hours=Digital.getHours()
    var minutes=Digital.getMinutes()
    var seconds=Digital.getSeconds()
    var dn="PM"
    if (hours<12)
    dn="AM"
    if (hours>12)
    hours=hours-12
    if (hours==0)
    hours=12
    if (minutes<=9)
    minutes="0"+minutes
    if (seconds<=9)
    seconds="0"+seconds
    var ctime=hours+":"+minutes+":"+seconds+" "+dn
    thelement.innerHTML="<b style='norm'>"+ctime+"</b>"
    setTimeout("show2()",1000)
    }
    window.onload=show2
    //-->
    </script>
              </td>
    
              <td></td>
              <td></td>
              <td><input type="submit"  alt="Submit" name="SUBMIT" value=SUBMIT>
          </form>
    	  
        </td>
        </tr>
    <br>
    
    
    Contact.php
    Code:
    <?
    
    $mailto = "";
    $mailto="blank@ConverseConsultants.com";
    $subject = "Converse Web Application";
    $redirect= "thankyou.html";
    
    $message = null;
    
    
    foreach ($_REQUEST as $k=>$v) {
    
      $message.="[$k] = $v\n\n";
    
    }
    
    mail($mailto, $subject, $message, "From: www@converseconsultants.com");
    
    header("Location: $redirect");
    ?>
    
    What am I doing wrong?
     
  2. Do you have a URL where we can test the page out?
     
  3. I removed it from our site. If you'd like, tomorrow, I can create a test page for you guys to test it out, and see if it works.
     
  4. deepak11627

    deepak11627 Guest

    misplaced form tags

    hi
    please try putting form tags either before or after the table tag.

    Thanks!
    CoreIT developers
     
  5. What isn't working exactly? Do you get a php error? Does it not submit at all? Do you receive a javascript error?

    I agree with jimmywh, please provide a URL where we can test it.
     
  6. On the first sight I don't see anything wrong. What error did you get here exactly? It's hard to tell what's wrong without seeing the outcome of the code...


     

Share This Page