-1

你好,我想做这样的事情:

<script>fid="canal1"; width=650; height=440;</script><script type="text/javascript" src="http://www.pirlotv.me/embed.js"></script>

该脚本创建一个可自动调整的 iframe

正如你在这里看到的

包含<iframe>带有视频流的脚本

在此处输入图像描述

当您更改URLhtml 文档中的宽度或高度属性时,它也会更改,我该怎么做呢?请帮我

4

1 回答 1

2

If I understand you correctly you will have to do something like this:

In the URL use get variables like so: www.mywebsite.com/page.php?width=200&height=300

Then use echo $_GET['width']; and echo $_GET['height']; to print where you need.

For example:

<script>fid="canal1"; width=<?php echo $_GET['width'];?>; height=<?php echo $_GET['height'];?>;</script>

I would also recomment using isset() function to see if the $_GET vars are actually set and if not assign some default value.. like this:

<?php echo isset($_GET['width']) ? $_GET['width'] : '250'; //250 being the default value ?>
于 2013-06-17T22:08:01.313 回答