litebearer Posted June 18, 2006 Share Posted June 18, 2006 Good Morning!I have close to NO knowledge in writing javascript. All of my experience has been using existing scripts and experimenting with changes til the desired result is achieved. That said here is the situation:1. Photo gallery, thumbs are shown as links to a popup window that displays the large image. This works as it should.2. I would like to be able to pass the variable containing the image's comments to the popup. I played around with appending the value to the end of the link; but no joy.here is the code for the thumb display portion[code]<script language="Javascript"> function PopupPic(sPicURL) { window.open ("popup.php?"+sPicURL, "", "resizable=1,HEIGHT=200,WIDTH=200");}</script>[/code]more stuff, then ...[code]$what_line = explode("|",$the_array[$what_cell_2]);$what_thumb = $what_line[2];$what_image = $what_line[1];$what_artist = $what_line[3];$what_date = $what_line[0];$what_title = $what_line[4];$what_comments = $what_line[5];?><td align=center valign=top><a href="javascrip t:PopupPic('<?PHP echo $what_image; ?>')" ><?PHP echo $what_date;?><br><IMG SRC="<?PHP echo $what_thumb; ?>" border=0></a><br><?PHP echo $what_title; ?> </td>[/code]this is the popup file[code]<?PHPsession_start(); ?><HTML> <HEAD> <TITLE>Our Family Photos</TITLE> <script language='javascript'> var arrTemp=self.location.href.split("?"); var picUrl = (arrTemp.length>0)?arrTemp[1]:""; var NS = (navigator.appName=="Netscape")?true:false; function FitPic() { iWidth = (NS)?window.innerWidth:document.body.clientWidth; iHeight = (NS)?window.innerHeight:document.body.clientHeight; iWidth = document.images[0].width - iWidth; iHeight = document.images[0].height - iHeight; window.resizeBy(iWidth, iHeight+45); self.focus(); }; </script> </HEAD> <BODY bgcolor="#ffffff" onload='FitPic();' topmargin="0" marginheight="0" leftmargin="0" marginwidth="0"> <script language='javascript'> document.write( "<img src='" + picUrl + "' border=0>" ); </script> <script language="javascript"> <!-- setTimeout("self.close();",10000) //--> </script> <center><form><input type=button value="Close This Window" onClick="javascript:window.close();"></form></center></BODY> </HTML><?PHP?>[/code]Thanks in advance,Lite... Quote Link to comment https://forums.phpfreaks.com/topic/12295-passing-extra-variables-to-a-popup/ Share on other sites More sharing options...
nogray Posted June 20, 2006 Share Posted June 20, 2006 In the second section, try changing the$what_image = $what_line[1];to$what_image = $what_line[1]."&Comments=".$what_line[5];and in the pop-up file add<?PHP echo $_GET['Comments']; ?>under the image Quote Link to comment https://forums.phpfreaks.com/topic/12295-passing-extra-variables-to-a-popup/#findComment-47731 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.