Jump to content

open two new window onclick


james_4k2

Recommended Posts

Hi there,

         

<input type="button" value="Hello" onclick="changeWindow('http://google.ca');" style="width: 200px;" /><br/><br/><br/>

 

i have a button in javascript onclicking to which a new window should open which consist of a webpage and some custom text at the top of webpage. As shown above google will open and in that new window I have to display at the top some text.Ex. " have a good day" . Note- I am using javascript in php

 

Please suggest something if anyone know the solution.

Thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/138233-open-two-new-window-onclick/
Share on other sites

so you want two different windows to open or only one? if you want two windows; add window.open() to the input button. otherwise; if your only wanting one window to open up; with the page your wanting to display and your wanting to add some of your own text to this page; do the following:

 

<input type="button" value="Hello" class="bbc_link new_win" target="_blank" style="width: 200px" on click="window.open('mypage.php?url=http://google.ca')">

 

mypage.php

 

<?php
$url_display = file_get_contents($_GET["url"]);
echo "have a good day";
echo "<br/><br/>";
echo "$url_display";
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.