Hello all,
If I use a "typical" href - No problems I see the session value being passed to the page (populating a form field). Using the pop up link not surprisingly nothing gets passed.
My lack of experience is letting me down here.
Any solutions or an alternative ?
Regards.
I'm getting the current page URL with this -
<?php
session_start();
function testmy_currenturl() {
$str = empty($_SERVER["HTTPS"]) ? '' : ($_SERVER["HTTPS"] == "on") ? "s" : "";
$test_proto = strleft(strtolower($_SERVER["SERVER_PROTOCOL"]), "/").$str;
$test_port = ($_SERVER["SERVER_PORT"] == "80") ? "" : (":".$_SERVER["SERVER_PORT"]);
return $test_proto."://".$_SERVER['SERVER_NAME'].$test_port.$_SERVER['REQUEST_URI'];
}
function strleft($s1, $s2) {
return substr($s1, 0, strpos($s1, $s2));
}
$_SESSION['url']=testmy_currenturl();
echo 'The content of $_SESSION[\'sess_var\'] is '
.$_SESSION['url'].'<br />';
?>
No issues there.
Using this JS for a pop up window -
<script language="JavaScript">
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=500,height=500');");
}
</script>
and
<p><a href="javascript:popUp('http://www.somesite/somepage.php')" />Tell a Friend</a></p>