473,320 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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
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
4 2220
ronverdonk
4,258 Expert 4TB
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
938 Expert 512MB
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
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
4,258 Expert 4TB
It is exactly as nathj says, IE parses differently from FF. Anyway, it is fixed.

Ronald
Feb 13 '08 #5

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

Similar topics

5
by: Tyler Style | last post by:
Hullo - looking for a little advice here. I have a form on a page in one domain submitting to a cgi in another domain. Weirdly, on some Windows XP systems, a form on the page fails to submit/post...
4
by: John Fereira | last post by:
So, one of the limitations of multipart-form handling is that when an <input type="file" ..> tag is used it will bring up a window which allows a user to select a file for upload but won't allow...
8
by: Adam | last post by:
Hey, I'm using JS to submit a form with image submit buttons, using the following code... (Page is here... http://www.cards2do.co.uk/addcard.php?card_id=292 ) ...
8
by: Ed Jay | last post by:
Is there a way to use 'document.form.submit()' to submit a form to a url other than that specified in the Form element? -- Ed Jay (remove M to respond by email)
4
by: sameergn | last post by:
Hi, I have an image in my HTML form which has onclick() handler. There is also a submit button and a text box. Whenever text box has focus and user presses enter, the onclick() event of...
8
by: nektir | last post by:
I have an external js file to validate a form and it works in IE and Opera, but not Mozilla Firefox. In Mozilla Firefox, the javascript console sasys "SearchForm" is not defined in the second...
11
by: Rik | last post by:
Hello guys, now that I'm that I'm working on my first major 'open' forms (with uncontrolled users I mean, not a secure backend-interface), I'd like to add a lot of possibilities to check wether...
18
by: NavinM | last post by:
I have a couple of forms that are misbehaving in FireFox, but work fine in IE. when i do submit( with submit button) a javascript function validates all of the fields entered, and stops the...
12
by: Daniel Klein | last post by:
I'm pretty new at php and web stuff so please be gentle with me. I'm trying to get a form to submit when the user presses the Enter key. I do not want to use javascript. I've googled this to...
1
Claus Mygind
by: Claus Mygind | last post by:
I am having some trouble submitting a form in IE. Works fine with FireFox. I have tried two methods. method #1 function validateForm(form) { if (document.getElementById("NAME").value...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.