小编Har*_*thi的帖子

如何在laravel中注册后自动登录

我在laravel中注册用户时遇到了一个问题,$user假设是包含所有数组元素的数组,而自动登录以下代码结果为false.密码保存在数据库中hash::make('password').

$user_id = $this->user_model->addUser($user);
$post = array('password' => $pass_for_auth, 'email' => $email);
var_dump(Auth::attempt($post,true));die;
Run Code Online (Sandbox Code Playgroud)

谁能告诉我什么是正确的问题

php laravel

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

重写url以删除问号并在htaccess中添加斜杠

我花了几个小时来尝试实现我认为很容易的目标。我有http://localhost/testing_url_document/second.php?id=2,想把它打开http://localhost/testing_url_document/second/id/2。我已经实现了删除php扩展名的功能,但是仍然无法重写站点页面。在htacces中,我遵循以下过程。

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
Run Code Online (Sandbox Code Playgroud)

这是我的索引页

Index.php

<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
    </head>
    <body>
        <?php
        // put your code here
        ?>
        <a href="second/id/2">click here</a>
    </body>
</html>
Run Code Online (Sandbox Code Playgroud)

Second.php

<?php 
 echo $_GET['id'];
?>
Run Code Online (Sandbox Code Playgroud)

second.php应该获取值2

在此先感谢您的帮助。

php apache .htaccess mod-rewrite

5
推荐指数
1
解决办法
1107
查看次数

navigator.mediaDevices.getUserMedia 在 ios 设备中显示黑屏

当流显示在 html5 视频标签上时,iOS 设备中的屏幕显示空白,显示黑屏。但在其他设备上到处都可以正常工作。这是js代码

它在单屏中工作,但是当点对点 js 调用 twillio 时,它会显示黑屏,而视频会话在两个设备和用户之间启动

navigator.mediaDevices.getUserMedia({video:true}).then(function(stream) {
                 document.getElementById("myVideo").setAttribute('autoplay', '');
    document.getElementById("myVideo").setAttribute('muted', '');
    document.getElementById("myVideo").setAttribute('playsinline', '');   
                      
        document.getElementById("myVideo").srcObject = stream;
   document.getElementById("myVideo").play();
   
   }).catch(function(error) {
    console.log(error.name + ": " + error.message);
    alert(error.name + ": " + error.message);
    
  });
Run Code Online (Sandbox Code Playgroud)

这是 HTML 代码

<video id="myVideo" allow="camera;microphone" class="silhouetteVideo" style="" autoplay playsinline controls="false"></video>
Run Code Online (Sandbox Code Playgroud)

html javascript video

5
推荐指数
1
解决办法
2996
查看次数

标签 统计

php ×2

.htaccess ×1

apache ×1

html ×1

javascript ×1

laravel ×1

mod-rewrite ×1

video ×1