duanniying2342 2018-02-28 08:05
浏览 14
已采纳

如何找出用户来自哪个URL

I work at a company, lets call it 'A', that got taken over by company 'B' but basiclaly still is its own company.

Now I have made an application, but my boss and I thought it would be a nice idea to change the design of the page depending on from wich of the two company's the user is from.

The company's both have their own login site and system. And if there is maintenance or a failure on the system they get redirected to my application which sais this.

I am wondering if there is a way to define from wich of the two URL's the user came from so I can change the design of the site to that company.

P.S. the application is written in PHP

  • 写回答

1条回答 默认 最新

  • drduh44480 2018-02-28 08:23
    关注

    To handle such cross site communication, I would use Cookies.

    Redirect the client sites to a script on the maintenance server, which sets a cookie and then further redirects to a page, which on hand the Cookie can custom the content.

    Redirection link on client site

    http://www.example-maintenanceserver.com/setcookie.php?client_id=123
    

    The setcookie.php (maintenance server)

    <?php
        setcookie("client_id", $_GET['client_id']);
        header("location:custom_client_page.php");
    ?>
    

    The custom_client_page.php (maintenance server)

    <?php
        $client_id = $_COOKIE['client_id'];
        .....
        // tailor custom content for client id
    ?>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 单片机学习顺序问题!!
  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)
  • ¥15 相敏解调 matlab
  • ¥15 求lingo代码和思路
  • ¥15 公交车和无人机协同运输
  • ¥15 stm32代码移植没反应
  • ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效
  • ¥100 连续两帧图像高速减法
  • ¥15 如何绘制动力学系统的相图