0

我正在尝试将一些参数传递给 iframe,它在所有浏览器中都可以正常工作,除了 IE。

对于我正在尝试做的事情,我找不到任何其他解决方案,但也许 IE 不接受要发送到 iframe 的参数?

这就是我所拥有的:

 <iframe src="https://portal.maxistore.com.br/dologin.php?
 email=<?php echo urlencode($user_info->user_login) ?>&timestamp=<?php echo urlencode($timestamp) ?>&hash=<?php echo $hash ?>&goto=<?php echo urlencode($goto_invoices) ?>" name="iframeTarget" id="iframeTarget" width="100%" height="1200px"></iframe>    

谢谢你。

4

1 回答 1

0

My answer has nothing to do with IE compatibility directly... I just wanted to point out a much more efficient way to build urls. Although, it may be beneficial to do it the proper way and eliminate the margin for error when building your urls.

With the use of http_build_query and sprintf you can build dynamic encoded urls with a single function versus all this interdom php code. Check it out:

Example

$Data = [
    'timestamp' => time(),
    'id' => 64,
    'email' => 'bobbyryan@aol.com',
];

$url = http_build_query($Data);

echo sprintf("http://www.example.com/?%s", $url);

Results in the following URL

http://www.example.com/?timestamp=1367951475&id=64&email=bobbyryan%40aol.com
于 2013-05-07T18:37:26.113 回答