How to open a popup

-1

I want to put a link with the name and that opens a pop up page.

<p>';
if($exibe['Nome1'] != NULL) {
echo '<p><b>Nome: </b>'.$exibe["Nome1"].'';
}'</p>

I want to show Nome and on it a link to open pop up .

    
asked by anonymous 12.06.2014 / 22:42

3 answers

3

Try to use it then:

<script language="JavaScript">
function abrir(URL) {

  var width = 150;
  var height = 250;

  var left = 99;
  var top = 99;

  window.open(URL,'janela', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');

}
</script>



<?php
echo '<p><a href="abrir("http://www.meusite.com.br");">'.$exibe["Nome1"].'</a></p>';
?>
    
13.06.2014 / 01:24
2

Hi, in php I think it's not possible, but you can use javasript, follow the code:

<a href="#" onclick="window.open('http://www.suapagina.com', 'Titulo da Janela', 'STATUS=NO, TOOLBAR=NO, LOCATION=NO, DIRECTORIES=NO, RESISABLE=NO, SCROLLBARS=YES, TOP=10, LEFT=10, WIDTH=770, HEIGHT=400');">Clique para abrir a janela POP-up</a>

You can also use this site to generate the code: link

Hope this is it! Hugs!

    
12.06.2014 / 23:27
0

You will not be able to with pure php. To open the popup, you will have to put a javascript code snippet. Something like:

<p>
    <a href="window.open('http://google.com.br', 'new-window');"><?php echo $exibe["Nome1"]; ?></a>
</p>
    
14.06.2014 / 21:48