Php 如何使用GET方法参数打开指向Url的iFrame?
编辑: 现在已经7天了,没有人回答我的3个问题。 没有人知道答案? 此url: http://localhost/test/pagination_2.php?col=$col&search=$search&limit=$limit&page=$i 等于: http://localhost/test/pagination_2.php?col=domain&search=heman.com&limit=10&page=1 注意url中的参数。在这里使用表单的GET方法 url是一个显示google类型分页的页面,显示“heman.com”关键字搜索的结果 现在,如果你去 http://localhost/test/pagination_2.php 然后想象一下,页面视图只显示一个带有关键字搜索html表单的普通页面。由于url中不存在搜索参数,因此页面上不显示关键字搜索结果 现在麻烦从这里开始 我猜下面4个iFrame(2,3,4和5)只是打开pagination_2.php,因为我看到iFrame没有显示关键字“heman.com”的搜索结果。似乎4个iFrame打开到一个页面,迫使浏览器不考虑url中的参数。为什么? 因此,如果你去: http://localhost/test/pagination_2.php 然后,您将看到我在4个iFrame中看到的页面的任何视图(没有搜索结果,因为url中没有GET方法参数) 4个相关iFrame加上1个打开到死页的iFrame: 尝试1(显示死页)Php 如何使用GET方法参数打开指向Url的iFrame?,php,html,iframe,Php,Html,Iframe,编辑: 现在已经7天了,没有人回答我的3个问题。 没有人知道答案? 此url: http://localhost/test/pagination_2.php?col=$col&search=$search&limit=$limit&page=$i 等于: http://localhost/test/pagination_2.php?col=domain&search=heman.com&limit=10&page=1 注意url中的参数。在这里使用表单的GET方法 url是一个显示google类
尝试2(打开页面时没有显示搜索结果,就像url中没有参数一样)
<iframe src='http://localhost/test/pagination_2.php?search=heman.com&tbl=browsing_histories&col=domain&limit='></iframe>
<?php
//Attempt 1
$_SESSION['url'] = $url = "http://localhost/test/pagination_2.php";
$_SESSION['search'] = $search = $domain; //'$search' value holds the 'keyword' to search.
$_SESSION['tbl'] = $tbl = 'browsing_histories';
$_SESSION['col'] = $col = 'domain'; //'$col' value holds the column to search.
$_SESSION['page'] = $page = 1;?>
<iframe src='<?php echo ".htmlentities($url)" .'?col=' .urlencode($col) .'&search=' .urlencode($search) .'&limit=' .urlencode($limit) .'&page=' .urlencode($page) ."'></iframe><br>";
printf("<iframe src='%s?col=%s&search=%s&limit=%d&page=%d'></iframe><br>",
htmlentities($url),
urlencode($col),
urlencode($search),
$limit,// %d place-holder will force integer
$i // ditto
);
echo "<iframe src='" .htmlentities($url) .'?col=' .urlencode($col) .'&search=' .urlencode($search) .'&limit=' .urlencode($limit) .'&page=' .urlencode($i) ."'></iframe><br>";
$i = 1;
$url2 = "http://localhost/test/pagination_2.php?col=$col&search=$search&limit=$limit&page=$i";
echo "<iframe src='" .htmlentities($url2) .urlencode($url2) ."'></iframe><br>";