如何隐藏Iframe src? [英] How to hide Iframe src?

查看:251
本文介绍了如何隐藏Iframe src?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何隐藏src,如下所示。如果exam​​ple.php内容为php,MySQL的功能和形式。那么当一些访问者检查页面中的查看源时,我该如何隐藏src。



< iframe src =example.phpheight = 300width =200scrolling =nosandbox =allow-formsseamless =seamlessid =example1>< / iframe>



< div id =panel>

content



< / div>

解决方案

首先,用户不会像服务器上看到的那样获取.php文件(如果您有PHP服务器)。
它将被解析,剩下的将是纯HTML。
所以你的用户不会看到SQL-Queries等。



但是你试图做的事情是不可能的。这不是HTML的工作原理。您点击显示源代码时看到的内容正是浏览器用来显示页面的内容。因此,如果您不会为iFrame提供src值,那么浏览器将无法正确显示它。


How to hide the src as shown in below. If the example.php contents php , MySQL functions and forms. So how do I hide the src when some visitor checks view source in the page.

<iframe src="example.php" height="300" width="200" scrolling="no" sandbox="allow-forms" seamless="seamless" id="example1"></iframe>

<div id="panel">

content

</div>

解决方案

First, the user won't get the .php-File like you see it on the Server (if you have a PHP-Server). It will get parsed and what will remain is plain HTML. So your user won't see SQL-Queries, etc.

But what you're trying to do is impossible. That's not how HTML works. What you see when you click "show Sourcecode" is exactly what the browser uses to display the Page. So if you won't deliver a src-value for your iFrame, than the browser won't be able to show it correctly

这篇关于如何隐藏Iframe src?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆