Page 1 of 1

GET Problems...

Posted: Sat Sep 09, 2006 7:21 pm
by tommy1987
I am trying to make an image so people can click on it for a larger picture in a new window, the new window is appearing but it is not getting the URL passed to it using GET. This seems strange to me because it works when opened in the same window (i.e. If I copy shortcut), just not when opened in the popup window. The link appears correct in the bottom left of the browser when hovered over, however when it opens the new window it just displays the standard URL with no passed variables as the link had.

Here is the code:

Code: Select all

<A HREF="imgzoom.php?imgfile=<?=$imgurl?>"
onClick="popup = window.open('imgzoom.php', 'PopupPage', 'height=600,width=540,scrollbars=yes,resizable=yes'); return false" target="_blank">
<img width="75" 
         height="75" 
         src="<?=$imgurl?>" 
         valign="top" 
         style="border:1px solid gray;" 
         alt="<?=$name?> - Click for closeup" 
/>
</a>



my code for the new window:

Code: Select all

<?php
if(isset($_GET['imgfile'])) {
  echo 'URL FOUND!';
  $imgurl = $_GET['imgfile'];  
} else {
  echo 'URL NOT FOUND!';
}
?>
<html>
  <body bgcolor="#B2B2B2" align="center">
    <img src="<?=$imgurl?>" width="500" height="500" alt="" style="border:1px solid gray;" align="center" />
    <br/><br/>
    <center><a href="javascript:self.close()">Close Preview</a></center>
  </body>
</html>

Posted: Sat Sep 09, 2006 7:41 pm
by wtf
try this

Code: Select all

<A HREF="javascript:;"
onClick="window.open('imgzoom.php?imgfile=<?=$imgurl?>'
.....

Posted: Sun Sep 10, 2006 4:20 am
by tommy1987
thanks I should have spotted something that simple... it was late :D