【问题标题】:Iframe ejecution stops phpiframe 弹出停止 php
【发布时间】:2017-03-14 21:30:37
【问题描述】:

我一直试图在我的 php 代码中间设置一个 iframe,但它使我的 php 代码下车;

代码测试:

<?php
    $pdf = "";

    $pdf.= "hola <br>";
    $pdf.= "<iframe src='https://www1.sedecatastro.gob.es/Cartografia/mapa.aspx?refcat=001901800VM18D0001OS' width='500' height='500' align='center' />";
    $pdf.= "<br> hola2";


    echo $pdf;

找不到此页面停止我的代码的原因。

【问题讨论】:

标签: php html iframe


【解决方案1】:
<?php
     $url = "https://www1.sedecatastro.gob.es/Cartografia/mapa.aspx?refcat=001901800VM18D0001OS";
if (isset ($url)) { // decode the url and display it in the iframe
            $pdf .= ' hola<br>';
            $pdf .= '<iframe  src="'.urldecode($url).'"></iframe>';
            $pdf .= '<br> hola2';
            echo $pdf;
     } else { // display a static page if no url parameter was received
           $pdf .=  ' hola <br>';
           $pdf .=  '<iframe src="http://myurl.com/mycontent.html"></iframe>';
           $pdf .=  '<br> hola2';
           echo $pdf;
        }
  ?>

工作正常

http://phpfiddle.org/

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-06-01
    • 2016-07-31
    • 1970-01-01
    • 2017-02-07
    • 1970-01-01
    • 2015-02-12
    • 2021-04-26
    • 2013-05-23
    相关资源
    最近更新 更多