ERROR 403 - FORBIDDEN

时间:2014-03-16 10:11:47

标签: php redirect login get

示例网址:

" 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');
 }
 ?>

1 个答案:

答案 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'));
}
?>