简单的网络程序设计题 分数多多

来源:百度知道 编辑:UC知道 时间:2024/06/06 08:55:06
按要求编写程序:
1)编写一个HTML页面index.html,其中包括一个表单(form),表单中有两个文本输入框(分别命名为username和userpwd),一个提交按钮和一个取消按钮。表单的动作action指向 2)中所写的脚本(login.jsp)。
2)使用jsp或者php编写一个服务器端的脚本程序(login.jsp),接收客户端的输入,判断username与userpwd是否相等,相等时在页面上显示:welcome,X X X(username变量的值)!;不相等时在页面上显示:Error!Please input again!。

<HTML>
<HEAD>

<Script Language ="JavaScript">

function check(){

if (document.mytable.elements[0].value == document.mytable.elements[1].value){
document.write("welcome, " + document.mytable.elements[0].value);
}else{
document.write("Error!Please input again!");
}
}
</Script>

</HEAD>

<BODY>

<Form Name="mytable">

username:

<Input Type="text" Name="text1" Value="">

userpwd:

<Input Type="text" Name="text2" Value="">
<Input Type="button" Value="submit" onClick="check()">
<Input Type="reset" Value="cancel" onClick="">
</Form>

</BODY>

</HTML>

第1个简单哈。第2个没学过哦