简体   繁体   English

iFrame 使用 PHP 在 URL 中传递用户名和密码

[英]iFrame Pass username and password inside URL using PHP

I have tried the below code to load the iframe page to my view file but was unable to get a response.我已尝试使用以下代码将 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>

If I Run a direct URL in the browser then get the iframe page.如果我在浏览器中直接运行 URL 然后得到 iframe 页面。

So i can pass username, password with that iframe URL.所以我可以使用 iframe URL 传递用户名和密码。

The way you using the code for load the iframe using htpasswd - basic authentication is seems to correct it may be the issue with Cross-origin.您使用代码使用 htpasswd 加载 iframe 的方式 - 基本身份验证似乎可以纠正它可能是跨域的问题。

you can check the Console and see if you getting the Erro for Cross-origin, then you will need to allow the your sit url(where you add this iframe) to source ifram url project or add the allow Cross-origin for your domain to that ifram url script eg"abc.com/send_sms".你可以检查控制台,看看你是否得到了跨域的错误,那么你需要允许你的坐 url(你添加这个 iframe 的地方)来获取 ifram url 项目或为你的域添加允许跨域到ifram url 脚本,例如“abc.com/send_sms”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将URL中的用户名和密码传递给PHP页面? - Pass username and password in URL to PHP page? 将用户名和密码从PHP传递到Apache - Pass username & password from PHP to Apache 将Freeradius用户名和密码传递给外部php文件 - Pass Freeradius Username and Password to external php file 通过IFrame传递用户名和密码 - Passing Username and Password with IFrame 我可以使用PHP将URL变量传递给IFrame吗? - Can I Pass a URL variable to an IFrame using PHP? 如何使用curl在Watson Assistant中传递apikey和助手URL而不是用户名和密码 - how to pass apikey and assistant url instead of username and password in watson assistant using curl 我的php脚本没有使用给定的用户名/ pass / host而是使用root @ localhost(密码:NO) - My php script is not using given username/pass/host rather using root@localhost (password: NO) 使用php下载文件通过传递用于http身份验证的用户名和密码,从给定的URL - using php Download File From a given URL by passing username and password for http authentication 使用PHP登录时比较用户名和密码 - Compare username and password during login using PHP 如何使用 php 使用带有用户名和密码的 API? - How to consume an API with username and password using php?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM