Free Credit Reports - CRM Software Small Busines - Mortgages - Credit Cards - Credit Cards UK

PDA

View Full Version : How to open a new window (popup window) with PHP?


Javver
Feb 18th 2008, 8:47 am
How to open a new window (popup window) with PHP? where i can also adjust the size of the window in the script?

nico_swd
Feb 18th 2008, 8:51 am
PHP is not capable of doing that. You need Javascript.

And you can find a LOT of examples with Google.

Javver
Feb 18th 2008, 8:55 am
thanks for the advise

i have one now.. thanks a lot!

rajarak
Jun 30th 2008, 2:43 pm
Were u able to get in PHP or JScript?

Thanks

Vooler
Jun 30th 2008, 2:50 pm
Secondly, most of today's browsers block popup windows. So better is fins some solution that creates a pop-like child windows within the page, I can provide such code if needed. And also, it can be made dragable using mouse button.

regards

rajarak
Jun 30th 2008, 2:57 pm
Can you gimme some directions or sample code on opening such child windows within the page

Thank you for your time!!

Vooler
Jun 30th 2008, 3:28 pm
Sure raja.

Here goes our Vooler popUp

<script language="javascript">
function show_popup(id) {
if (document.getElementById){
obj = document.getElementById(id);
if (obj.style.display == "none") {
obj.style.display = "";
}
}
}
function hide_popup(id){
if (document.getElementById){
obj = document.getElementById(id);
if (obj.style.display == ""){
obj.style.display = "none";
}
}
}
</script>

<div id="my_popup" style="display:none;border:1px dotted gray;padding:.3em;background-color:white;position:absolute;width:200px;height:200px;left:100px;top:100px">
<div align="right">
<a href="javascript:hide_popup('my_popup')">close</a>
</div>
<h3>Vooler PopUp</h3>
<p>You contents go here, whatever style or anything</p>
</div>


Somewhere in code
<a href="javascript:show_popup('my_popup')">Show popup</a>


I hope it helps.

regards

mordimi
Jun 30th 2008, 4:48 pm
or this example <script type="text/javascript">
<!--
var stile = "top=10, left=10, width=600, height=800 status=no, menubar=no, toolbar=no scrollbar=no";
function Popup(apri) {
window.open(apri, "", stile);
}
//-->
</script>
<a href="javascript:Popup('YOURPAGE.html')">show popup</a>


cheers

rajarak
Jun 30th 2008, 6:10 pm
thank you so much,
it does helps!!