anujgarg Posted December 5, 2007 Share Posted December 5, 2007 Stuck into a problem. Trying to pass session values from parent to popup window. But failed. I am using the following: session.php (parent window): $value1=$_SESSION['name']; echo "<a href=\"javascript:window.open('page.php?sid=<?php echo $value1;?>','name1','height=320,width=240');\">pop-up</a>"; page.php (popup window): $a=session_id(strip_tags($_GET['sid'])); session_start(); echo $a; Any thoughts? Quote Link to comment Share on other sites More sharing options...
Stooney Posted December 5, 2007 Share Posted December 5, 2007 session.php: session_start(); echo "<a href=\"javascript:window.open('page.php?sid=".$_SESSION['name']."','name1','height=320,width=240');\">pop-up</a>"; page.php: $a=session_id(strip_tags($_GET['sid'])); session_start(); echo $a; should work for what you're doing. Mainly you're sytax was wrong in session.php Quote Link to comment Share on other sites More sharing options...
anujgarg Posted December 5, 2007 Author Share Posted December 5, 2007 the thing is that whenever I click the button to open popup window, it appears with blank page. Also, the parent window also gets submitted. How can I solve these problems? In short, session value is not appearing in pop-up. Quote Link to comment Share on other sites More sharing options...
jitesh Posted December 5, 2007 Share Posted December 5, 2007 Parent ----------------------------- session_start(); $sesison_id = session_id(); echo "<a href=\"javascript:window.open('page.php?sid=".$sesison_id."','name1','height=320,width=240');\">pop-up</a>"; .................. .................. Child ----------------------------------- session_id($_GET['sid']); session_start(); ............. ............... Quote Link to comment Share on other sites More sharing options...
anujgarg Posted December 5, 2007 Author Share Posted December 5, 2007 thanks for the replies. is there any other method to pass the session or values from parent to popup without using querystring? I m asking this just for the sake of security. TIA Quote Link to comment 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.