Hi guys,
I am pretty new to PHP and I am having some problems with a Submit button. Basically, it works flawlessly when in Firefox 2.0.0.4 but not in IE5,IE6 or Opera 9.21.
When I click it, nothing happens. Even Reset does not work.
The code is:
add_feedback.php
<?php
session_start();
if($_SESSION["loggedin"] != "AtKi29Mn00zuUl1an8")
{
$URL="index.php";
header ("Location: $URL");
echo 'You are not logged in, <a href="index.php">click here</a> to proceed.';
}
include'init.php';
$id = $_GET['id'];
?>
<html>
<head>
<title>Inappropriate Feedback Form</title>
<script type="text/javascript" src="datetimepicker.js">
//Date Time Picker script- by TengYong Ng of http://www.rainforestnet.com
//Script featured on JavaScript Kit (http://www.javascriptkit.com)
//For this script, visit http://www.javascriptkit.com
</script>
<script type="text/javascript">
function Load_id(){
var id = document.feedback.dept.options[document.feedback.dept.selectedIndex].value;
var id_txt = "?id=";
location = id_txt + id;
}
</script>
</head>
<?php
if (!isset($_POST['submit']))
{
// Show the form
include 'add_feedback.inc.php';
exit;
}
else
{
// Check if any of the fields are missing
if (empty($_POST['timedate']) || empty($_POST['cust_name']) || empty($_POST['cust_cli']) || empty($_POST['details']))
{
// Reshow the form with an error
$reg_error = 'One or more fields missing';
include 'add_feedback.inc.php';
exit;
}
// Everything is ok, register
submit_feedback ($_POST['timedate'], $_POST['dept'], $_POST['advisor'], $_POST['area'], $_POST['cust_name'], $_POST['cust_cli'], $_POST['amdocs_ref'], $_POST['fb_cat'], $_POST['details']);
// echo $_POST['timedate'], $_POST['dept'], $_POST['advisor'], $_POST['area'], $_POST['cust_name'], $_POST['cust_cli'], $_POST['amdocs_ref'], $_POST['fb_cat'], $_POST['details'];
echo 'Thank you for submitting your feedback, <a href="menu.php">click here</a> to go back.';
}
?>
</html>
add_feedback.inc.php
<body>
<?php if (isset($reg_error)) { ?>
There was an error: <?php echo $reg_error; ?>, please try again.
<?php } ?>
<div align=center>
<form name="feedback" action="add_feedback.php" method=POST
enctype="application/x-www-form-urlencoded">
<table border=0 cellspacing=3 cellpadding=0 width=617>
<tr>
<td width="36%" valign=top>
<p align=right>Your Name : </p>
</td>
<td width="63%" valign=top>
<p><b><?php echo ($_SESSION['forename'] ." " .$_SESSION['surname']); ?></b></p>
</td>
</tr>
<tr>
<td width="36%" valign=top>
<p align=right>Select Department : </p>
</td>
<td width="63%" valign=top>
<?php
$q = mysql_query("SELECT * FROM departments");
echo"<select name=\"dept\" onChange=\"Load_id()\">";
echo"<option value='blank'>-- Select Department --</option>";
while($row = mysql_fetch_array($q)) {
$result = $row['service_area'] ." - " .$row['department_name'];
$selected = ($result == $id)? "SELECTED":"";
echo"<option ";
if($id == $result) echo "SELECTED ";
echo"value=\"".$row['service_area'] ." - " .$row['department_name']."\"". $selected." >".$row['service_area'] ." - " .$row['department_name'] ."</option>";
}
echo"</select>";
?>
</td>
</tr>
<tr>
<td width="36%" valign=top>
<p align=right>Select Advisor : </p>
</td>
<td>
<?php
$q2 = mysql_query("SELECT * FROM user WHERE department = '$id' AND level = 'Advisor' ORDER BY manager,surname");
echo"<select name=\"advisor\">";
echo"<option value='blank'>-- Select Advisor --</option>";
while($row = mysql_fetch_array($q2)) {
echo"<option value=\"".$row['forename'] ." " .$row['surname'] ."\">".$row['forename'] ." " .$row['surname']." [ " .$row['manager'] ." ]" ."</option>";
}
echo"</select></form>";
?>
</td>
</tr>
<tr>
<td width="36%" valign=top>
<p align=right>Date/Time of Call : </p>
</td>
<td width="63%" valign=top>
<p><input name="timedate" id="timedate" type="text" size="25"><a href="javascript:NewCal('timedate','ddmmmyyyy',true,24)"><img src="images/cal.gif" width="16" height="16" border="0" alt="Pick a date"></a></p>
</td>
</tr>
<tr>
<td width="36%" valign=top>
<p align=right>Area : </p>
</td>
<td width="63%" valign=top>
<p><SELECT NAME="area">
<OPTION SELECTED VALUE="billing">Billing Enquiry</option>
<OPTION VALUE="cancellation">Cancellation</option>
<OPTION VALUE="customer_service">Customer Service</option>
</SELECT></p>
</td>
</tr>
<tr>
<td width="36%" valign=top><p align=right>Inappropriate : </p></td>
<td width="63%" valign=top><input type="radio" name="fb_cat" value="Inappropriate" checked="checked" /></td>
</tr>
<tr>
<td width="36%" valign=top><p align=right>Cold Transfer : </p></td>
<td width="63%" valign=top><input type="radio" name="fb_cat" value="cold" /></td>
</tr>
<tr>
<td width="36%" valign=top><p align=right>Positive Feedback : </p></td>
<td width="63%" valign=top><input type="radio" name="fb_cat" value="Positive" /></td>
</tr>
<tr>
<td width="36%" valign=top>
<p align=right>Customer Name : </p>
</td>
<td width="63%" valign=top>
<p><b><input name="cust_name" type="text" size="51" maxlength="50"/></b></p>
</td>
</tr>
<tr>
<td width="36%" valign=top>
<p align=right>Customer CLI : </p>
</td>
<td width="63%" valign=top>
<p><b><input name="cust_cli" type="text" size="15" maxlength="15"/></b></p>
</td>
</tr>
<tr>
<td width="36%" valign=top>
<p align=right>Amdocs Ref : </p>
</td>
<td width="63%" valign=top>
<p><b><input name="amdocs_ref" type="text" size="10" maxlength="10"/></b></p>
</td>
</tr>
<tr>
<td width="36%" valign=top>
<p align=right>Details:</p>
</td>
<td width="63%" valign=top>
<p><TEXTAREA name="details" rows="10" cols="40"></TEXTAREA></p>
</td>
</tr>
<tr>
<td width="100%" colspan=2 valign=top>
<p align=center><input type="submit" name="submit" value="submit" /> <input type="reset" name="reset" value="reset" /></p>
</td>
</tr>
</table>
</form>
</div>
</body>
Can anyone help?
Thanks!