Jump to content

sessions from parent to pop-up


anujgarg

Recommended Posts

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
Share on other sites

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.