I always get a error message:document.form1.user isn't an object.
if i get rid of session_start(),everything becomes well.
thanks in advane!
<?php
session_start();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>login </TITLE>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<STYLE type=text/css>TABLE {
FONT-SIZE: 10.5pt
}
</STYLE>
<SCRIPT language=JavaScript>
<!--
function Jtrim(str)
{
var i = 0;
var len = str.length;
if ( str == "" ) return( str );
j = len -1;
flagbegin = true;
flagend = true;
while ( flagbegin == true && i< len)
{
if ( str.charAt(i) == " " )
{
i=i+1;
flagbegin=true;
}
else
{
flagbegin=false;
}
}
while (flagend== true && j>=0)
{
if (str.charAt(j)==" ")
{
j=j-1;
flagend=true;
}
else
{
flagend=false;
}
}
if ( i > j ) return ("")
trimstr = str.substring(i,j+1);
return trimstr;
}
function check(){
if
((Jtrim(document.form1.user.value)=="")||(Jtrim(document.form1.password.value)=="")){
window.alert("please input username/password!");
return false;
}
else
return true;
}
-->
</SCRIPT>
<META content="MSHTML 5.00.3314.2100" name=GENERATOR></HEAD>
<BODY onload=Javascript:document.form1.user.focus() bgColor=#ffffff>
<P align=center><B><FONT size=4>login</FONT></B></P>
<HR color=#008000 SIZE=4 width="60%">
<FORM action=loginsave.php method=post name=form1 onsubmit="return
check()">
<TABLE align=center bgColor=#f6f6f6 border=1 borderColorDark=#ffffff
borderColorLight=#cccccc cellPadding=0 cellSpacing=0 height=154
width=225>
<TBODY>
<TR>
<TD height=54 width=63>user:</TD>
<TD height=54 width=156><INPUT name=user> </TD></TR>
<TR>
<TD height=49 width=63>password</TD>
<TD height=49 width=156><INPUT name=password type=password>
</TD></TR>
<TR>
<TD height=45 width=63> </TD>
<TD height=45 width=156>
<P align=center></P></TD></TR></TBODY></TABLE>
<P align=center><INPUT name=Submit2 type=submit value=enter> <INPUT
name=Submit type=reset value=cancel> </P></FORM>
<HR color=#f6f6f6 SIZE=4 width="60%">
<P align=center><FONT color=#c0c0c0>y.k .co
2001</FONT></P></BODY></HTML>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php