zoukankan      html  css  js  c++  java
  • PHP、JSP、ASP获取前一个页面的URl

    PHP

    $_SERVER['HTTP_REFERER'];

    例子

    index.php

    <?php

    /*

     * To change this template, choose Tools | Templates

     * and open the template in the editor.

     */

    ?>

    <html>

        <head><title>frist page</title></head>

        <body>

            <form action="test02.php" mrthod="post" >

                message<input type="text" name="name" value="123456" ></input>

                <input type="submit" value="submit" ></input>

            </form>

        </body>

    </html>

    Test02.php

    <?php

    /*

     * To change this template, choose Tools | Templates

     * and open the template in the editor.

     */

     echo $_SERVER['HTTP_REFERER'];

    ?>


    JSP

    request.getHeader("Referer");

    例子

    index.jsp

    <%--

        Document   : index

        Created on : 2011-11-2, 9:54:43

        Author     : admin

    --%>

    <%@page contentType="text/html" pageEncoding="UTF-8"%>

    <!DOCTYPE html>

    <html>

        <head>

            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

            <title>first page</title>

        </head>

        <body>

            <form action="test01.jsp" method="post" >

                massage<input type="text" name="name" value="massage" ></input>

                <input type="submit" value="submit" ></input>

            </form>

        </body>

    </html>

    test01.jsp

    <%--

        Document   : test01

        Created on : 2011-11-2, 9:57:05

        Author     : admin

    --%>

    <%@page contentType="text/html" pageEncoding="UTF-8"%>

    <%

    String url = request.getHeader("Referer");

    out.println(url);

    %>

    ASP

    <%=Request.ServerVariables( "HTTP_REFERER ")%>

    例子

    index.asp

    <html>

        <head>

            <title>frist page</title>

        </head>

        <body>

            <form action="test.asp" method="post" >

                massage<input type="text" name="name" value="message" />

                <input type="submit" value="submit">

            </form>

        </body>

    </html>

    test.asp

    <html>

        <head>

            <title></title>

    </head>

    <%=Request.ServerVariables( "HTTP_REFERER ")%>

        <body>

            <%=url%>

        </body>

    </html>

  • 相关阅读:
    用leangoo看板工具实施多团队大规模敏捷开发
    单团队的Scrum敏捷开发-leangoo
    放弃在每日站会上按成员逐个发言
    Leangoo思维导图做OKR目标管理
    好用的思维导图软件(程序员必备)
    好用免费的思维导图工具,多人协作共同编辑
    什么是Scrum燃尽图?
    Scrum中文网-团队需要Scrum Master做这六件事
    项目管理工具Leangoo自定义字段的应用
    实施敏捷开发中,选择看板管理工具的几个要点
  • 原文地址:https://www.cnblogs.com/Jerry-blog/p/5010166.html
Copyright © 2011-2022 走看看