【问题标题】:iFrame Pass username and password inside URL using PHPiFrame 使用 PHP 在 URL 中传递用户名和密码
【发布时间】:2022-01-24 04:45:04
【问题描述】:

我已尝试使用以下代码将 iframe 页面加载到我的视图文件中,但无法获得响应。

<section class="slice color-three pb-4">
   <div class="w-section inverse p-0">
     <div class="card col-md-12 pb-4">
        <iframe id="sms_service" src="https://username:password@abc.com/send_sms?account=123456789" height="450" width="100%"></iframe>                                                     
     </div>
   </div>
</section>

如果我在浏览器中运行直接 URL,则获取 iframe 页面。

所以我可以使用该 iframe URL 传递用户名、密码。

【问题讨论】:

    标签: php codeigniter-3


    【解决方案1】:

    您使用代码使用 htpasswd 加载 iframe 的方式 - 基本身份验证似乎可以纠正,这可能是跨域的问题。

    你可以检查控制台,看看你是否得到了跨域的错误,那么你需要允许你的坐 url(你添加这个 iframe 的地方)源 iframe url 项目或添加允许跨域您的域到该 ifra url 脚本,例如“abc.com/send_sms”。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-04-06
      • 1970-01-01
      • 2021-09-03
      • 1970-01-01
      • 2020-06-12
      • 2020-03-06
      • 2011-06-20
      • 1970-01-01
      相关资源
      最近更新 更多