繁体   English   中英

php重定向搞砸了

[英]Php Redirecting is messed up

文件重定向到该文件,其中包含:

<?
if(!session_id()) {
session_start();
if (strlen($_SESSION['login']) < 1)
die("you're not logged in!");
}
$changer = $_POST['form1'];
switch($changer) {
case 'write':
header("Location: http://teachertechtutor.com/php/learn/kinder/write.php");
break;

case 'read':
header("Location: http://teachertechtutor.com/php/learn/kinder/read.php");
break;

case 'math':
header("Location: http://teachertechtutor.com/php/learn/kinder/math.php");
break;
}
?>

但是当这个重定向时,它增加了一个类似数学的奇怪的东西: http : //teachertechtutor.com/redirects/kinder.php? math= Math%21

为什么要添加整个重定向内容...? redirects / kinder.php?math = Math%21应该是php / learn / kinder / math.php

%21

代表html中的感叹号。 URL编码功能

由于这是重定向到kinder.php文件,因此.htaccess文件很有可能会导致所有URL都重定向到kinder.php文件。

在您的.htaccess文件中查找包含“ kinder.php”的所有代码,以查找问题所在。 至于调整它,如果您能够发布.htaccess代码,我将非常乐意为您提供帮助。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM