Submit Button called thru java not appearing in PHP page.
Posted: Mon Jul 08, 2002 3:43 am
Hi
I have this notice board function which works correctly in all browsers except for netscape 6 ( the submit button just doesnt appear )
can anyone see why this may be happening??
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<meta name="generator" content="Adobe GoLive 4">
<title>Welcome to the Website - Display Notices</title>
</head>
<body bgcolor="white">
<ul>
<br>
<script language="javascript"><!--
function getvalue(SelfSubmit)
{
document.frmdisplay.action="displaynotice.php3?SelfSubmit=" + SelfSubmit;
document.frmdisplay.method="post";
document.frmdisplay.submit();
}
// -->
</script>
<div align="left">
<p><font face="Arial"><strong><img height="29" width="392" src="gif/noticbrd.gif"></strong></font></p>
</div>
<p>
<form name="frmdisplay">
<font face="Arial" font size="1"><select name="cbochoice" size="1">
<option value="1" <% if ($cbochoice=="1") echo " selected"; %>>This Week
<option value="2" <% if ($cbochoice=="2") echo " selected "; %>>Last Week
<option value="3" <% if ($cbochoice=="3") echo " selected "; %>>3 Weeks Ago<font face="Arial" font size="1"><input type="button" name="Submit" value="VIEW NOTICES" onclick="javascript:getvalue('true')">
</select></font>
</form>
<?
if ($SelfSubmit=='true')
{
$matchfound="false";
$qrystring=getenv(QUERY_STRING);
include('./include/header.inc');
$cn=mysql_connect($dbhost,$dbuser,$dbpasswd) or die("cannot connect to the server");
$db=mysql_select_db($dbname) or die("cannot connect to the database");
$dt=date('Y/m/d');
$ydt=date('Y/m/d',mktime(0,0,0,date("m"),date("d")-1*7,date("Y")));
$bydt=date('Y/m/d',mktime(0,0,0,date("m"),date("d")-2*7,date("Y")));
$byydt=date('Y/m/d',mktime(0,0,0,date("m"),date("d")-3*7,date("Y")));
switch($cbochoice)
{
case"1":
$Str="select Heading,AuthName,AuthEmail,SubDt,Body from TblNoticeBoard where (SubDt>\"$ydt\" and SubDt<=\"$dt\") ";
$day=" This Week ";
break;
case"2":
$Str="select Heading,AuthName,AuthEmail,SubDt,Body from TblNoticeBoard where (SubDt>\"$bydt\" and SubDt<=\"$ydt\") ";
$day="in the Last Week";
break;
case"3":
$Str="select Heading,AuthName,AuthEmail,SubDt,Body from TblNoticeBoard where (SubDt>\"$byydt\" and SubDt<=\"$bydt\") ";
$day="in the Last to Last Week";
break;
}
$rst=mysql_query($Str);
echo "<hr>";
do
{
$row=mysql_fetch_row($rst);
if(!$row) { break;}
$matchfound="true";
$dat=explode("-",$row[3]);
$newdate=date('d/m/Y',mktime(0,0,0,$dat[1],$dat[2],$dat[0]));
echo "<div align='left'><table bgcolor='#FFFFFF' border='0' width='450'><tr><td nowrap><td colspan='5' width='10'><font size='1' face='Arial'><strong>HEADING:</strong></font></td>";
echo "<td nowrap><td width='450'><b><font size='2' font face='Arial' font color='#001899'>".$row[0]."</b></font></td></tr></table></left></div>";
echo "<div align='left'><left><table border='0' bgcolor='#FFFFFF' width='450'><tr><td nowrap><td width='45'><font size='1' face='Arial'><strong>AUTHOR:</strong></font></td><td nowrap><td width='100'><b><font size='1' font face='Arial'>".$row[1]."</b></td></font><td nowrap><td width='20'><font size='1' face='Arial'><strong>EMAIL:</strong></font></td><td nowrap><td width='135'><font size='1' font face='Arial'>".$row[2]."</td></font><td nowrap><td width='20'><font size='1' face='Arial'><strong>DATE:</strong></font></td><td nowrap><td width='35'><font size='1' font face='Arial'>".$newdate."</td></font></tr></table></left></div>";
echo "<br><font size='1' font face='Arial'>".$row[4]."<hr></font>";
}while($row);
mysql_free_result($rst);
if($matchfound=="false")
{
echo "<p><pre><font face=\"Arial\"><b>Sorry! no notices.</b></font></pre></p>";
}
}
?>
</ul>
</body>
</html>
Hopefully all that code wont bugger up the forum
Im thinking maybe the javascript function for self submit might not be 6 compatible but Im not really sure.
Thanks for your help
Mark Rendell
I have this notice board function which works correctly in all browsers except for netscape 6 ( the submit button just doesnt appear )
can anyone see why this may be happening??
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<meta name="generator" content="Adobe GoLive 4">
<title>Welcome to the Website - Display Notices</title>
</head>
<body bgcolor="white">
<ul>
<br>
<script language="javascript"><!--
function getvalue(SelfSubmit)
{
document.frmdisplay.action="displaynotice.php3?SelfSubmit=" + SelfSubmit;
document.frmdisplay.method="post";
document.frmdisplay.submit();
}
// -->
</script>
<div align="left">
<p><font face="Arial"><strong><img height="29" width="392" src="gif/noticbrd.gif"></strong></font></p>
</div>
<p>
<form name="frmdisplay">
<font face="Arial" font size="1"><select name="cbochoice" size="1">
<option value="1" <% if ($cbochoice=="1") echo " selected"; %>>This Week
<option value="2" <% if ($cbochoice=="2") echo " selected "; %>>Last Week
<option value="3" <% if ($cbochoice=="3") echo " selected "; %>>3 Weeks Ago<font face="Arial" font size="1"><input type="button" name="Submit" value="VIEW NOTICES" onclick="javascript:getvalue('true')">
</select></font>
</form>
<?
if ($SelfSubmit=='true')
{
$matchfound="false";
$qrystring=getenv(QUERY_STRING);
include('./include/header.inc');
$cn=mysql_connect($dbhost,$dbuser,$dbpasswd) or die("cannot connect to the server");
$db=mysql_select_db($dbname) or die("cannot connect to the database");
$dt=date('Y/m/d');
$ydt=date('Y/m/d',mktime(0,0,0,date("m"),date("d")-1*7,date("Y")));
$bydt=date('Y/m/d',mktime(0,0,0,date("m"),date("d")-2*7,date("Y")));
$byydt=date('Y/m/d',mktime(0,0,0,date("m"),date("d")-3*7,date("Y")));
switch($cbochoice)
{
case"1":
$Str="select Heading,AuthName,AuthEmail,SubDt,Body from TblNoticeBoard where (SubDt>\"$ydt\" and SubDt<=\"$dt\") ";
$day=" This Week ";
break;
case"2":
$Str="select Heading,AuthName,AuthEmail,SubDt,Body from TblNoticeBoard where (SubDt>\"$bydt\" and SubDt<=\"$ydt\") ";
$day="in the Last Week";
break;
case"3":
$Str="select Heading,AuthName,AuthEmail,SubDt,Body from TblNoticeBoard where (SubDt>\"$byydt\" and SubDt<=\"$bydt\") ";
$day="in the Last to Last Week";
break;
}
$rst=mysql_query($Str);
echo "<hr>";
do
{
$row=mysql_fetch_row($rst);
if(!$row) { break;}
$matchfound="true";
$dat=explode("-",$row[3]);
$newdate=date('d/m/Y',mktime(0,0,0,$dat[1],$dat[2],$dat[0]));
echo "<div align='left'><table bgcolor='#FFFFFF' border='0' width='450'><tr><td nowrap><td colspan='5' width='10'><font size='1' face='Arial'><strong>HEADING:</strong></font></td>";
echo "<td nowrap><td width='450'><b><font size='2' font face='Arial' font color='#001899'>".$row[0]."</b></font></td></tr></table></left></div>";
echo "<div align='left'><left><table border='0' bgcolor='#FFFFFF' width='450'><tr><td nowrap><td width='45'><font size='1' face='Arial'><strong>AUTHOR:</strong></font></td><td nowrap><td width='100'><b><font size='1' font face='Arial'>".$row[1]."</b></td></font><td nowrap><td width='20'><font size='1' face='Arial'><strong>EMAIL:</strong></font></td><td nowrap><td width='135'><font size='1' font face='Arial'>".$row[2]."</td></font><td nowrap><td width='20'><font size='1' face='Arial'><strong>DATE:</strong></font></td><td nowrap><td width='35'><font size='1' font face='Arial'>".$newdate."</td></font></tr></table></left></div>";
echo "<br><font size='1' font face='Arial'>".$row[4]."<hr></font>";
}while($row);
mysql_free_result($rst);
if($matchfound=="false")
{
echo "<p><pre><font face=\"Arial\"><b>Sorry! no notices.</b></font></pre></p>";
}
}
?>
</ul>
</body>
</html>
Hopefully all that code wont bugger up the forum
Im thinking maybe the javascript function for self submit might not be 6 compatible but Im not really sure.
Thanks for your help
Mark Rendell