相关疑难解决方法(0)

重定向到页面并发送自定义HTTP标头

我使用以下代码重定向到PHP中的页面.我需要设置自定义HTTP标头以与重定向一起传递.

header("Location: http://...");
Run Code Online (Sandbox Code Playgroud)

我该如何存档?

php redirect http

7
推荐指数
2
解决办法
1万
查看次数

Laravel Redirect 在事件处理程序/侦听器中不起作用

我有一个 Auth.Attempt 事件处理程序类,我检测用户的登录尝试以决定锁定用户的帐户。但是,当我尝试使用闪现消息将用户重定向到登录页面时,我发现重定向不起作用,仍然继续下一步。我想在事件发生时中断该过程并给出我的自定义警告消息。谁能帮我吗?多谢。

我的事件处理程序:

namespace MyApp\Handlers\Security;

use DB;
use Session;
use Redirect;

class LoginHandler 
{
    /**
     * Maximum attempts
     * If user tries to login but failed more than this number, User account will be locked
     * 
     * @var integer
     */
    private $max_attemtps;

    /**
     * Maximum attempts per IP
     * If an IP / Device tries to login but failed more than this number, the IP will be blocked
     * 
     * @var integer
     */
    private $ip_max_attempts;

    public function __construct()
    { …
Run Code Online (Sandbox Code Playgroud)

redirect laravel laravel-4

4
推荐指数
1
解决办法
5029
查看次数

标签 统计

redirect ×2

http ×1

laravel ×1

laravel-4 ×1

php ×1