doureng5668 2016-11-30 23:28
浏览 13
已采纳

在我的网址中间添加了5个字符

I realise that this might be a VERY obscure question but it's driving me mad, I have 5 extra characters being inserted into the URL while navigating between the pages on my site. (eg. http://track.chhs.nsw.edu.au/UXTWP/userAccount.php?) The UXTWP is being added and I'm not sure where from but it is breaking the navigation randomly.

The site is hosted on goDaddy. It contains HTML CSS PHP JavaScript and mySQL. Everything was working well until I added a "fix" in PHP to stop a potential 'hack' that would use an id being passed in the URL to switch the viewed content. I'm not sure this was the problem but that was the most recent change before the errors started occurring.

this is the site I also looked to place the code up on phpfiddle but I'm not sure what to add?

if(isset($_GET['a'])){
    if(strpos($userRow['sID'], $_GET['a']) !== false) {
        $_SESSION['student']=$_GET['a'];
        $tempArray = db_select("SELECT *  FROM student WHERE sID ='".$_SESSION['student']."'");
        $studentRow = array_shift($tempArray);
        $_SESSION['impactTool'] =$studentRow['impactAssToolID'];
        $SName = $studentRow['sName'];
        $SDOB = $studentRow['dob'];
        $SFormDate = $studentRow['formDate'];
        $prevInf = $studentRow['prevInfo'];
        $famInf = $studentRow['famInfo'];
        $contInf = $studentRow['contextInfo'];
        $impactIDMsg = "?z=".$_SESSION['impactTool'];
        $btnFlag = true;
        }else{
            header("Location:logout.php");
        }

The intention is to dump the user back to the login screen via logout if they attempt to access a student's detail that doesn't belong to them.

Thanks in advance for any help provided.

  • 写回答

2条回答 默认 最新

  • dongyue9860 2016-12-05 01:44
    关注

    Ok this time I think it is fixed!! Thank you so much @Progrock for your persistent testing and ideas. The fix: I have included a blank .htaccess file into the root of the site. Now I can navigate through the different pages using the onsite navigation and the browser navigation and I can't create the error anymore.

    I'm hoping that this is a permanent fix and my best guess is that it was the browser/server looking for the .htaccess file on particular triggers when not finding it looking to the server generic .htaccess file.

    Hope this post helps someone in the future experiencing a similar problem.

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

报告相同问题?

悬赏问题

  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)