简体   繁体   English

php重定向搞砸了

[英]Php Redirecting is messed up

A file redirects to this file which contains: 文件重定向到该文件,其中包含:

<?
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;
}
?>

but when this one redirects it adds a weird thing like for the math one: http://teachertechtutor.com/redirects/kinder.php?math=Math%21 但是当这个重定向时,它增加了一个类似数学的奇怪的东西: http : //teachertechtutor.com/redirects/kinder.php? math= Math%21

why does it add the whole redirects thing...? 为什么要添加整个重定向内容...? redirects/kinder.php?math=Math%21 should be php/learn/kinder/math.php redirects / kinder.php?math = Math%21应该是php / learn / kinder / math.php

%21

Stands for an exclamation point in html. 代表html中的感叹号。 URL Encoding Functions URL编码功能

Since this is redirecting to the kinder.php file, this is more than likely an issue with the .htaccess file causing all of your URLS to redirect to the kinder.php file. 由于这是重定向到kinder.php文件,因此.htaccess文件很有可能会导致所有URL都重定向到kinder.php文件。

Take a look in your .htaccess file for any code containing "kinder.php" to locate the issue. 在您的.htaccess文件中查找包含“ kinder.php”的所有代码,以查找问题所在。 As far as adjusting it, if you are able to post the .htaccess code, I would be more than happy to assist. 至于调整它,如果您能够发布.htaccess代码,我将非常乐意为您提供帮助。

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

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