duanbodai5166 2009-09-03 05:46
浏览 60
已采纳

如何在这种情况下进行URL屏蔽?

I am using php, js, flash and mysql on 1 website.

I want to do a URL masking using frameset(or maybe iframe). Scenario:

An user click on a link, which direct him/her to my page with this url:

www.domain.com/index.php?var1=string1&var2=string2

How to mask the url so that visitor can only see www.domain.com/index.php, but actually there are some variables over there. I need the variables, but i dont want the visitors to see. How to do URL masking on this? (I dont expect to get any code, I just want to know the logic of the url masking method)

PS. I probably would not use mod_rewrite, because I dont know how to use/write the code. So please, answer with iframe/frameset methods :)

  • 写回答

2条回答 默认 最新

  • drk7700 2009-09-03 06:19
    关注

    EDIT: I think I misunderstood your question, so here is another attempt:

    In www.yourdomain.com/index.php:

    <?php
    
    session_start();
    
    if (isset($_REQUEST['flashvar']) && ! isset($_SESSION['flashvar'])) {
    
        // Store any parameters received
        $_SESSION['flashvar'] = $_REQUEST['flashvar'];
    
        // Redirecting without query parameters
        header('Location: /index.php');
        exit;
    }
    ?>
    <HTML>
    <HEAD></HEAD>
    <BODY>
    <?php
      echo '<embed src="player.swf?flashvar=',
           urlencode($_SESSION['flashvar']), '"/>';
    ?>
    </BODY>
    </HTML>
    

    This example will start a session and redirect the user to itself without needing to store any parameters in the query string. Naturally, it will only work if the user has cookies enabled.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 依据报错在原代吗格式的基础上解决问题
  • ¥15 在虚拟机中安装flash code
  • ¥15 单片机stm32f10x编写光敏电阻调节3.3伏大功率灯亮度(光强越大灯越暗,白天正常光强灯不亮,使用ADC,PWM等模块)望各位找一下错误或者提供一个可实现功能的代码
  • ¥20 verilog状态机方法流水灯
  • ¥15 pandas代码实现不了意图
  • ¥15 GD32H7 从存储器到外设SPI传输数据无法重复启用DMA
  • ¥25 LT码在高斯信道下的误码率仿真
  • ¥45 渲染完成之后将物体的材质贴图改变,自动化进行这个操作
  • ¥15 yolov5目标检测并显示目标出现的时间或视频帧
  • ¥15 电视版的优酷可以设置电影连续播放吗?