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
Email.php
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"> </td>
</tr>
<tr>
<td>Venue:</td>
<td><select name="venueName" id="venueName">
<option value="Aura">Aura</option>
</select></td>
<td> </td>
</tr>
<tr>
<td>Fullname:</td>
<td><input type="text" name="fullName" maxlength="50" id="fullName" /></td>
<td> </td>
</tr>
<tr>
<td>E-mail</td>
<td><input type="text" name="emailAddress" maxlength="50" id="emailAddress" /></td>
<td> </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> </td>
</tr>
<tr>
<td>Mobile:</td>
<td><input type="text" name="mobile" maxlength="50" /></td>
<td> </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> </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>
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");
?>
Comment