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? Link to comment https://forums.phpfreaks.com/topic/80227-sessions-from-parent-to-pop-up/ 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 Link to comment https://forums.phpfreaks.com/topic/80227-sessions-from-parent-to-pop-up/#findComment-406660 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. Link to comment https://forums.phpfreaks.com/topic/80227-sessions-from-parent-to-pop-up/#findComment-406663 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(); ............. ............... Link to comment https://forums.phpfreaks.com/topic/80227-sessions-from-parent-to-pop-up/#findComment-406677 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 Link to comment https://forums.phpfreaks.com/topic/80227-sessions-from-parent-to-pop-up/#findComment-406692 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.