1

我从这里开始:

在此处输入图像描述

使用该代码:

<!DOCTYPE html>
<html>
<head><title>Bank application</title>
<link rel="stylesheet"
      href="./css/styles.css"
      type="text/css"/>
</head>
<body>
<table class="title">
  <tr><th>Web Bank application</th></tr>
</table>

<br/>
<fieldset>
  <legend>Login Page - please enter your Username and Password</legend>
  <form action="loginPage"> 
    Username: <input type="text" name="username"><br>
    Password : <input type="text" name="password"><br>
    <input type="submit" value="Login">
  </form>
</fieldset>

<br/>
<br/>
<br/>

<fieldset>
  <legend>Registration</legend>
  <form action="register"> 
    First name: <input type="text" name="firstName"><br>
    Last name : <input type="text" name="lastName"><br>
    Address   : <input type="text" name="address"><br>
    ID-number : <input type="text" name="idnumber"><br>
    User-Name : <input type="text" name="userName"><br>
    Password  : <input type="text" name="password"><br>
    <input type="submit" value="Register">
  </form>
</fieldset>

<br/>
<br/><br/><br/><br/><br/><br/>
</body></html>

当我从一页移动到另一页时,我到达了这里:

在此处输入图像描述

使用该代码:

<!DOCTYPE html>
<html>
<head><title>Authentication failed - a problem has occurred!</title>
<link rel="stylesheet"
      href="./css/styles.css"
      type="text/css"/>
</head>
<body>
<h1>Sorry , but you are not registered to our bank!</h1>

<fieldset>
  <legend>Please press here to continue</legend>
  <form action="goingBack"> 
    <input type="submit" value="Press here">
  </form>
</fieldset>

</body></html>

我想回到index.html - 程序启动时看到的第一页(上面的第一张图片)。

我怎样才能做到这一点 ?我怎样才能转发回来index.html

问候

4

2 回答 2

2

只需在最后一个 HTML 中添加上一页的链接:

<!DOCTYPE html>
<html>
<head><title>Authentication failed - a problem has occurred!</title>
<link rel="stylesheet"
      href="./css/styles.css"
      type="text/css"/>
</head>
<body>
<h1>Sorry , but you are not registered to our bank!</h1>

<fieldset>
  <legend>Please press here to continue</legend>
  <form action="goingBack"> 
    <input type="submit" value="Press here">
  </form>
</fieldset>

 <a href="index.jsp">Go Back</a> <!-- add this -->

</body></html>
于 2012-08-07T08:51:19.507 回答
1

你只需要javascript。/index.html5秒后重定向到:

setTimeout('window.location='index.html';', 5000);

setTimeout()是一个javascript函数,它设置一个定时器以在给定的时间段后触发somehting。window.location是一个变量,允许您更改当前页面的 URL(从而重定向)。

于 2012-08-07T08:48:08.460 回答