By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,521 Members | 1,492 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,521 IT Pros & Developers. It's quick & easy.

Form not submitting in firefox?

P: 6
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
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <style type="text/css">
  3. <!--
  4. .style10 {color: #6A3292}
  5. .style9 {font-size: 12px}
  6. -->
  7. </style>
  8. <form action="email.php" method="post">
  9. <body>
  10.   <table width="423" border="0" align="left" cellpadding="3" cellspacing="0">
  11.     <tr>
  12.       <td width="91">Event Date:</td>
  13.       <td width="195"><label>
  14.         <select name="eventDate" id="eventDate">
  15.           <option value="2008-3-18">2008-3-18</option>
  16.               </select>
  17.       </label></td>
  18.       <td width="119">&nbsp;</td>
  19.     </tr>
  20.     <tr>
  21.       <td>Venue:</td>
  22.       <td><select name="venueName" id="venueName">
  23.         <option value="Aura">Aura</option>
  24.                   </select></td>
  25.       <td>&nbsp;</td>
  26.     </tr>
  27.     <tr>
  28.       <td>Fullname:</td>
  29.       <td><input type="text" name="fullName" maxlength="50" id="fullName" /></td>
  30.       <td>&nbsp;</td>
  31.     </tr>
  32.     <tr>
  33.       <td>E-mail</td>
  34.       <td><input type="text" name="emailAddress" maxlength="50" id="emailAddress" /></td>
  35.       <td>&nbsp;</td>
  36.     </tr>
  37.     <tr>
  38.       <td height="31">Guests:</td>
  39.       <td><label>
  40.         <textarea name="guests" id="guests" cols="30" rows="5">Fullname, E-mail</textarea>
  41.       </label></td>
  42.       <td>&nbsp;</td>
  43.     </tr>
  44.  
  45.     <tr>
  46.       <td>Mobile:</td>
  47.       <td><input type="text" name="mobile" maxlength="50" /></td>
  48.       <td>&nbsp;</td>
  49.     </tr>
  50.     <tr>
  51.       <td>Table:</td>
  52.       <td><label>
  53.         <select name="table" size="1" id="table">
  54.           <option value="no" selected>No</option>
  55.           <option value="Yes">Yes</option>
  56.                                 </select>
  57.       </label></td>
  58.       <td>&nbsp;</td>
  59.     </tr>
  60.     <tr>
  61.       <td colspan="2" align="right"><a href="index.php" class="style10">
  62.         <input name="Submit" type="submit" value="Submit!" />
  63.         </a></td>
  64.     </tr>
  65.   </table>
  66. </form>
  67. </body>
  68. </html>
  69.  
Email.php
Expand|Select|Wrap|Line Numbers
  1.  <?php
  2.       error_reporting(E_ALL);
  3.       ini_set('display_errors', true);
  4.  
  5.       //  Rest of the PHP code
  6.       mysql_query($query, $link_id) or die('<hr />MySQL Error: ' .mysql_error(). '<hr />');
  7. ?>
  8. <?php
  9.  
  10. // Receiving variables
  11. @$pfw_ip= $_SERVER['REMOTE_ADDR'];
  12. @$eventDate = addslashes($_POST['eventDate']);
  13. @$venueName = addslashes($_POST['venueName']);
  14. @$fullName = addslashes($_POST['fullName']);
  15. @$emailAddress = addslashes($_POST['emailAddress']);
  16. @$guests = addslashes($_POST['guests']);
  17. @$mobile = addslashes($_POST['mobile']);
  18. @$table = addslashes($_POST['table']);
  19.  
  20. // Validation
  21. //Sending Email to form owner
  22. $pfw_header = "From: $emailAddress\n"
  23.   . "Reply-To: $emailAddress\n";
  24. $pfw_subject = " $eventDate - $venueName";
  25. $pfw_email_to = "vip@aaaaaa.com";
  26. $pfw_message = "Visitor's IP: $pfw_ip\n"
  27. . "Date: $eventDate\n"
  28. . "Venue: $venueName\n"
  29. . "FullName: $fullName\n"
  30. . "Email: $emailAddress\n"
  31. . "Guests:\n$guests\n"
  32. . "Mobile: $mobile\n"
  33. . "Table: $table\n";
  34. @mail($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
  35.  
  36. //Sending auto respond Email to visitor
  37. $pfw_header = "From: vip@v-parties.com\n"
  38.   . "Reply-To: vip@aaaa.com\n";
  39. $pfw_subject = "aaaaaa.Com  - $venueName";
  40. $pfw_email_to = "$emailAddress";
  41. $pfw_message = "Submitted\n"
  42. . "\n"
  43. . "Venue: $venueName\n"
  44. . "Date: $eventDate";
  45. @mail($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
  46.  
  47. //saving record in a text file
  48. $pfw_file_name = "Data.csv";
  49. $pfw_first_raw = "fullName,emailAddress,guests,mobile\r\n";
  50. $pfw_values = "$fullName,$emailAddress,".str_replace ("\r\n","<BR>",$guests ).",$mobile\r\n";
  51. $pfw_is_first_row = false;
  52. if(!file_exists($pfw_file_name))
  53. {
  54.  $pfw_is_first_row = true ;
  55. }
  56. if (!$pfw_handle = fopen($pfw_file_name, 'a+')) {
  57.  die("Cannot open file ($pfw_file_name)");
  58.  exit;
  59. }
  60. if ($pfw_is_first_row)
  61. {
  62.   if (fwrite($pfw_handle, $pfw_first_raw ) === FALSE) {
  63.   die("Cannot write to file ($pfw_filename)");
  64.   exit;
  65.   }
  66. }
  67. if (fwrite($pfw_handle, $pfw_values) === FALSE) {
  68.   die("Cannot write to file ($pfw_filename)");
  69.   exit;
  70. }
  71. fclose($pfw_handle);
  72.  
  73.  echo("Submitted");
  74. ?>
  75.  
  76.  
Feb 12 '08 #1
Share this Question
Share on Google+
4 Replies


ronverdonk
Expert 2.5K+
P: 4,258
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
Feb 13 '08 #2

nathj
Expert 100+
P: 938
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
Feb 13 '08 #3

P: 6
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.
Feb 13 '08 #4

ronverdonk
Expert 2.5K+
P: 4,258
It is exactly as nathj says, IE parses differently from FF. Anyway, it is fixed.

Ronald
Feb 13 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.