【发布时间】:2011-06-10 15:49:06
【问题描述】:
我有:
<?php
$goto = $_GET['goto'];
?>
和:
<form method="get"><input type="text" name="goto" id="goTo" /></form>
<iframe id="page" src="http://<?php echo $goto; ?>"></iframe>
如果我转到我的页面,除非我以 ?goto=<webadress> 结束 URL,否则不会显示任何内容。
示例:http://example.com/windows8/apps/Flake/index.php?goto=http://google.com
如果用户没有输入?goto=http://google.com,我怎样才能使页面显示为备用网站?
【问题讨论】:
-
除了乔恩的回答,还需要在表单中添加提交按钮