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
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";
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.