Re: PHP Session in new window
From: Harrie Verveer (newsgroup{remove-this}_at_harrieverveer.com)
Date: 01/14/05
- Next message: Matt: "Books for beginners"
- Previous message: chlori: "URL manager"
- In reply to: Axrock: "PHP Session in new window"
- Next in thread: Axrock: "Re: PHP Session in new window"
- Reply: Axrock: "Re: PHP Session in new window"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 14 Jan 2005 10:47:23 +0100
Hi axrock,
I think you can't do things with the session because you are switching
between https and http... Do you really need the entire session from the
popup window or just succes or not? You could try some javascript like this:
<script language="JavaScript">
window.opener.location = "success.php";
</script>
when you really want the session vars you could do this by get-vars:
<?
$passGetVars = array();
foreach ($_SESSION as $key => $val)
$passGetVars[] = $key . "=" . $val;
$passGetVarsStr = "?" . implode("&",$passGetVars);
?>
<script language="JavaScript">
window.opener.location = "success.php<?=passGetVarsStr?>";
</script>
something like that... untested but should work - however, I don't think
it's possible to just use the same session in the opener window and the
popup window (because of the cross-protocol). this sollution isn't the
most pretty solution in the world, but it should work...
Harrie
Axrock wrote:
> Hi,
>
> I really need some help here.
>
> I have a shopping cart where all cart contents are stored in a session
> array. At the checkout stage, a new window is opened on a secure URL for
> entering credit card details. This is a new window (JavaScript popup)
> because the payment section is actually part of the bank. They have a
> payment gateway. I am able to pass variables to this which will be returned.
>
> Problem is on return (successful transaction etc) I cannot access the
> session variables in the parent browser window.
>
> Can I some how force the popup window (with some PHP code in the return
> page) to pickup that session so I can access the session variables from the
> parent window and update them based on my transaction result?
>
> I can and have the ability to pass the session id into the popup which will
> be returned when the transaction is completed via the banks automated
> system.
>
> If somebody can help me out in this area, I would really appreciate it.
>
> C.
>
>
- Next message: Matt: "Books for beginners"
- Previous message: chlori: "URL manager"
- In reply to: Axrock: "PHP Session in new window"
- Next in thread: Axrock: "Re: PHP Session in new window"
- Reply: Axrock: "Re: PHP Session in new window"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|