james_4k2 Posted December 23, 2008 Share Posted December 23, 2008 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 Quote Link to comment Share on other sites More sharing options...
webster08 Posted December 24, 2008 Share Posted December 24, 2008 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"; ?> Quote Link to comment Share on other sites More sharing options...
james_4k2 Posted December 24, 2008 Author Share Posted December 24, 2008 Thank you Webster08, I will try this Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.