douli7841 2016-12-01 15:03
浏览 45

我正面临着关于URL的问题

i have to get just 2 parameter in URL in this order http://localhost/StudentGuideBook/AdminPanel/viewInstitute.php?type=Govermnet&Category=University

i will get this first time when i click on the two value but after this i will getting this type of link http://localhost/StudentGuideBook/AdminPanel/viewInstitute.php?type=Govermnet&Category=University&Category=College&type=Govermnet

i want to override the value is the link not to concate this anny solutions ???

in the code i have check the Complete URL of server as $CompleteLink = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];

<div class="just-padding">
                <div class="list-group list-group-root well">
                    <a href="#" class="list-group-item">Search By Type</a>
                    <div class="list-group">
                       <?php
                        if (strpos($CompleteLink, $mark) !== false){
                            echo "<a href='$CompleteLink&type=Private' class='list-group-item'>Private Institutes</a>";
                            echo "<a href='$CompleteLink&type=Govermnet' class='list-group-item'>Goverment Institutes</a>";
                            echo "<a href='$CompleteLink&type=all' class='list-group-item'>All Institutes</a>";
                        } else {
                            echo "<a href='" . BASE_URL . "AdminPanel/viewInstitute.php?type=Private' class='list-group-item'>Private Institutes</a>";
                            echo "<a href='" . BASE_URL . "AdminPanel/viewInstitute.php?type=Govermnet' class='list-group-item'>Goverment Institutes</a>";
                            echo "<a href='" . BASE_URL . "AdminPanel/viewInstitute.php?type=all' class='list-group-item'>All Institutes</a>";
                        }
                        ?>
                    </div>
                </div>
                <div class="list-group list-group-root well">
                    <a href="#" class="list-group-item">Search By Category</a>
                    <div class="list-group">
                         <?php
                        if (strpos($CompleteLink, $mark) !== false){
                            echo "<a href='$CompleteLink&Category=University' class='list-group-item'>University</a>";
                            echo "<a href='$CompleteLink&Category=College' class='list-group-item'>College</a>";
                            echo "<a href='$CompleteLink&Category=Technical Academy' class='list-group-item'>Technical Academy</a>";
                        } else {
                            echo "<a href='" . BASE_URL . "AdminPanel/viewInstitute.php?Category=University' class='list-group-item'>University</a>";
                            echo "<a href='" . BASE_URL . "AdminPanel/viewInstitute.php?Category=College' class='list-group-item'>College</a>";
                            echo "<a href='" . BASE_URL . "AdminPanel/viewInstitute.php?Category=Technical Academy' class='list-group-item'>Technical Academy</a>";
                        }
                        ?>
                    </div>
                </div>
            </div> 

This is the link i am getting

</div>
  • 写回答

1条回答 默认 最新

  • douxiong2999 2016-12-01 15:33
    关注

    I think somehow $CompleteLink is mutated before it is echoed. If you don't want to hustle through your code to find where it is mutated, you can try to do $CompleteString = substr($CompleteLink, 0, (strpos($CompleteLink, '?'))); right before you echo it

    评论

报告相同问题?

悬赏问题

  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分
  • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题
  • ¥15 linux驱动,linux应用,多线程