Form not submitting in firefox?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bleachie
    New Member
    • Feb 2008
    • 6

    Form not submitting in firefox?

    Hi,

    My e-mail form seems to work fine in IE7 but doesn't work in FireFox2.0 - it just goes to the index.php instead of echoing the completed message.

    Hope someone can help me out.

    Form.html
    Code:
    <html>
    <style type="text/css">
    <!--
    .style10 {color: #6A3292}
    .style9 {font-size: 12px}
    -->
    </style>
    <form action="email.php" method="post">
    <body>
      <table width="423" border="0" align="left" cellpadding="3" cellspacing="0">
        <tr>
          <td width="91">Event Date:</td>
          <td width="195"><label>
            <select name="eventDate" id="eventDate">
              <option value="2008-3-18">2008-3-18</option>
                  </select>
          </label></td>
          <td width="119">&nbsp;</td>
        </tr>
        <tr>
          <td>Venue:</td>
          <td><select name="venueName" id="venueName">
            <option value="Aura">Aura</option>
                      </select></td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>Fullname:</td>
          <td><input type="text" name="fullName" maxlength="50" id="fullName" /></td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>E-mail</td>
          <td><input type="text" name="emailAddress" maxlength="50" id="emailAddress" /></td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td height="31">Guests:</td>
          <td><label>
            <textarea name="guests" id="guests" cols="30" rows="5">Fullname, E-mail</textarea>
          </label></td>
          <td>&nbsp;</td>
        </tr>
        
        <tr>
          <td>Mobile:</td>
          <td><input type="text" name="mobile" maxlength="50" /></td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>Table:</td>
          <td><label>
            <select name="table" size="1" id="table">
              <option value="no" selected>No</option>
              <option value="Yes">Yes</option>
                                    </select>
          </label></td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td colspan="2" align="right"><a href="index.php" class="style10">
            <input name="Submit" type="submit" value="Submit!" />
            </a></td>
        </tr>
      </table>
    </form>
    </body>
    </html>
    Email.php
    Code:
     <?php
          error_reporting(E_ALL);
          ini_set('display_errors', true);
    
          //  Rest of the PHP code
          mysql_query($query, $link_id) or die('<hr />MySQL Error: ' .mysql_error(). '<hr />');
    ?>
    <?php
    
    // Receiving variables
    @$pfw_ip= $_SERVER['REMOTE_ADDR'];
    @$eventDate = addslashes($_POST['eventDate']);
    @$venueName = addslashes($_POST['venueName']);
    @$fullName = addslashes($_POST['fullName']);
    @$emailAddress = addslashes($_POST['emailAddress']);
    @$guests = addslashes($_POST['guests']);
    @$mobile = addslashes($_POST['mobile']);
    @$table = addslashes($_POST['table']);
    
    // Validation
    //Sending Email to form owner
    $pfw_header = "From: $emailAddress\n"
      . "Reply-To: $emailAddress\n";
    $pfw_subject = " $eventDate - $venueName";
    $pfw_email_to = "vip@aaaaaa.com";
    $pfw_message = "Visitor's IP: $pfw_ip\n"
    . "Date: $eventDate\n"
    . "Venue: $venueName\n"
    . "FullName: $fullName\n"
    . "Email: $emailAddress\n"
    . "Guests:\n$guests\n"
    . "Mobile: $mobile\n"
    . "Table: $table\n";
    @mail($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
    
    //Sending auto respond Email to visitor
    $pfw_header = "From: vip@v-parties.com\n"
      . "Reply-To: vip@aaaa.com\n";
    $pfw_subject = "aaaaaa.Com  - $venueName";
    $pfw_email_to = "$emailAddress";
    $pfw_message = "Submitted\n"
    . "\n"
    . "Venue: $venueName\n"
    . "Date: $eventDate";
    @mail($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
    
    //saving record in a text file
    $pfw_file_name = "Data.csv";
    $pfw_first_raw = "fullName,emailAddress,guests,mobile\r\n";
    $pfw_values = "$fullName,$emailAddress,".str_replace ("\r\n","<BR>",$guests ).",$mobile\r\n";
    $pfw_is_first_row = false;
    if(!file_exists($pfw_file_name))
    {
     $pfw_is_first_row = true ;
    }
    if (!$pfw_handle = fopen($pfw_file_name, 'a+')) {
     die("Cannot open file ($pfw_file_name)");
     exit;
    }
    if ($pfw_is_first_row)
    {
      if (fwrite($pfw_handle, $pfw_first_raw ) === FALSE) {
      die("Cannot write to file ($pfw_filename)");
      exit;
      }
    }
    if (fwrite($pfw_handle, $pfw_values) === FALSE) {
      die("Cannot write to file ($pfw_filename)");
      exit;
    }
    fclose($pfw_handle);
    
     echo("Submitted");
    ?>
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    What would you like to accomplish with the following statement
    [php]<td colspan="2" align="right">< a href="index.php " class="style10" >
    <input name="Submit" type="submit" value="Submit!" />
    </a></td>
    [/php]
    Do you want to submit the form or do you want to jump to index.php? Pick one.

    Ronald

    Comment

    • nathj
      Recognized Expert Contributor
      • May 2007
      • 937

      #3
      Originally posted by ronverdonk
      What would you like to accomplish with the following statement
      [php]<td colspan="2" align="right">< a href="index.php " class="style10" >
      <input name="Submit" type="submit" value="Submit!" />
      </a></td>
      [/php]
      Do you want to submit the form or do you want to jump to index.php? Pick one.

      Ronald
      Good catch ronverdonk, I had to read the code a few times to get that.

      It seems IE7 has parsed the code and decided it's a submit button after all and FF has parsed it and decide it's really a link.

      It can't be both.

      nathj

      Comment

      • bleachie
        New Member
        • Feb 2008
        • 6

        #4
        Originally posted by nathj
        Good catch ronverdonk, I had to read the code a few times to get that.

        It seems IE7 has parsed the code and decided it's a submit button after all and FF has parsed it and decide it's really a link.

        It can't be both.

        nathj
        ahhhh!! thanks guys :) - my mistake.

        Comment

        • ronverdonk
          Recognized Expert Specialist
          • Jul 2006
          • 4259

          #5
          It is exactly as nathj says, IE parses differently from FF. Anyway, it is fixed.

          Ronald

          Comment

          Working...