Jump to content

Sending a value with 'onClick'


essjay_d12

Recommended Posts

I am now trying to do it with sessions - the page I am sending it to is a pop up window yet it doesnt seem to echo out the session when I know it has set correctly in the previous page. here is my code

 

first page

session_start;
function curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
	$pageURL .= "://";
	if ($_SERVER["SERVER_PORT"] != "80") {
		 $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
	} else {
  		$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
	}
	return $pageURL;
}
$_SESSION['URL'] = curPageURL();
echo $_SESSION['URL'];
echo "<input type=\"button\" name=\"web_data\" value=\"Web Page ...\" ".
             "onclick=\"return window.open('http://localhost/page2.php', 'web_data', 'menubar=1,location=1,directories=1,toolbar=1,scrollbars,resizable,width=800,height=600');\" />\n";

the Correct URL and button appears

 

Page 2

session_start;
echo $_SESSION['URL'];
echo " Hello";

 

But only hello appears!!!

 

Anybody explain?

 

cheers

 

d

There are many other pages conflicting with this file, which may be doing a session_destroy - i cant view them to find out, is there another way (instead of sessions) how would I do the same thing using the function but possibly with cookies etc or any other ways?

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.