示例网址:
" example.com/MemberLogin重定向= http://www.example.com/My-Account/Details&#34?;的 - > 403错误
" example.com/MemberLogin重定向=我的账户/细节"的 - >没有错误
" example.com/MemberLogin&#34?;的 - >没有错误
这是什么原因?
MemberLogin.php
<?php
define("_VALID_PHP", true);
require_once("/.../init.php");
if ($user->logged_in)
redirect_to("http://www.example.com/Yonlendirme.php?redirect=" . $_GET['redirect'] . "");
if (isset($_POST['doLogin']))
: $result = $user->login($_POST['username'], $_POST['password']);
/* Login Successful */
if ($result)
: redirect_to("http://www.example.com/Yonlendirme.php?redirect=" . $_GET['redirect'] . "" );
endif;
endif;
?>
Yonlendirme.php
<?php if ($_GET['redirect'])
{
header('Location: ' . $_GET['redirect'] . '');
}
else
{
header('Location: http://www.example.com/My-Account');
}
?>
答案 0 :(得分:0)
你可以试试这个,但仍然说它不起作用吗?如果是这样,请在redirect_to
函数..
<?php
define("_VALID_PHP", true);
require_once("/.../init.php");
if ($user->logged_in)
redirect_to("http://www.example.com/Yonlendirme.php?redirect=".urlencode($_GET['redirect']));
if (isset($_POST['doLogin']))
: $result = $user->login($_POST['username'], $_POST['password']);
/* Login Successful */
if ($result)
: redirect_to("http://www.example.com/Yonlendirme.php?redirect=".urlencode($_GET['redirect']));
endif;
endif;
?>
...
<?php
if (isset($_GET['redirect']))
{
exit(header('Location: ' . urldecode($_GET['redirect'])));
}
else
{
exit(header('Location: http://www.example.com/My-Account'));
}
?>