PDA

View Full Version : Lauch WHOIS.PHP in a pop-up with javascript?



dubealex
07-14-2005, 06:41 PM
Hi, for my website I need to open the whois search result in a new window. I was already using a small javascript to create a pop-up the size I need, without the button and the status bar. I dont know if I can do this with something else than JavaScript...

Here's my situation:

The place from which the form will be filled is:

www.mydomain.com/file.php

the WHOIS system is in the following place:

www.mydomain.com/whois/whois.php

I want that, when the user click the button or the link, doesn't matter if its either one of those, it will open a pop up of 510X510, with customized window.

I use the following JavaScript code to do a pop-up:


<script language="JavaScript">

<!--
function Popup(page) {

myWin= open("whois/"+page, "fenetre",

"width=510,height=510,status=no,toolbar=no,menubar =no,resizable=yes,scrollbars=yes");

}
// -->
</script>

And I use the following link to use the javascript, on a normal link:


javascript:Popup('whois.php')

The JavaScript above does work perfectly, it was tested.

I just dont know how to end up having the WHOIS result open in its own customized pop-up ? Any other way than JavaScript is welcomed too, for as long as it can open in its own pop-up, its' good.

dubealex
07-14-2005, 07:08 PM
I'm sorry for answering my own topic, but I find a solution. SO if you are interested, here's how I did it:

I did not need any code from the form page, All I had to do is add an OnLoad code in the "Default Header" of the template for the WHOIS.PHP, in the <BODY> tag, as follows:


<body onLoad="resizeTo(510,510)">

This code will make the window resizes itself when it loads to the size you specify.

Then, all that is left to do is add the target="_blank" in both links from the form. It look like this:


<form name='whois_search' method='POST' action='whois/whois.php' target="_blank">

That is for the button. ANd for the "CHeck Multiple DOmain", it's as a normal link:


<a href="whois/whois.php?page=MultipleWhoisSearch" target="_blank">Check Multiple Domains</a>

And tada, it open in a new page, resized.

If you have any other solution, feel free to share them !

Patrick
07-15-2005, 01:15 AM
Sorry for not replying sooner, but I was away today.