开发者

PHP open link in iframe

开发者 https://www.devze.com 2022-12-11 08:48 出处:网络
I have the following code presently: if(isset($_POST[\'Movie\'])) { $check = $_POST[\'Movie\']; echo \"(left angle bracket)a target=\'imdb\' href=\'http://www.google.ca/search?hl=en&source=hp&fkt=3

I have the following code presently:

if(isset($_POST['Movie']))
{
    $check = $_POST['Movie'];
    echo "(left angle bracket)a target='imdb' href='http://www.google.ca/search?hl=en&source=hp&fkt=3948&fsdt=45174&q=$check imdb&btnI=I%27m+Feeling+Lucky&meta=&aq=f&oq='>IMDB PREVIEW";

}

This gives me a link to click which when I do click opens in an iframe cal开发者_StackOverflow中文版led imdb. How do I cut out the middle man (having to click the link) and just have this link open directly in the iframe.

I already have an iframe named imdb and I want to display the link in there.

**What I ended up doing was just to echo a new iframe with the same class as the other iframe so that the end user will not know that they are different iframes.


You did not include the source for the iframe itself, but basically, all you have to do is echo the URL into the iframe's src attribute:

echo '<iframe id="imdb" src="'.'http://www.google.ca/search?hl=en&source=hp&fkt=3948&fsdt=45174&q=$check imdb&btnI=I%27m+Feeling+Lucky&meta=&aq=f&oq="></iframe>';


I don't know if I understood your question, but maybe you want to do this:

echo '<iframe src="http://www.google.ca/search?hl=en&source=hp&fkt=3948&fsdt=45174&q=$check imdb&btnI=I%27m+Feeling+Lucky&meta=&aq=f&oq=" />';
0

精彩评论

暂无评论...
验证码 换一张
取 消