Ok,
You would have something like this:
Form page:
form.php
HTML Code:
<form action="members.php" method="POST">
Type something<input type="text" name="test">
<input type="submit">
</form>
members.php
PHP Code:
<html>
<head> ... </head>
<script type="text/javascript">
function poponload() {
window.open ("http://www.yoursite.com/memberspopup.php",
"mywindow","menubar=1,resizable=1,width=350,height=250");
}
</script>
<body onload="javascript: poponload()">
<?php
$var = $_POST['text'];
$_SESSION['text'] = $var;
$sql = "INSERT ...." // insert data into database
?>
memberspopup.php
PHP Code:
<?php
$var = $_SESSION['text'];
echo 'the text is: '.$var;
?>
I have not tested the code at all so I am sure there are errors but the basic idea is that as well as submitting the data to the database, you also save it in the session and then retrieve the session data in the popup window. Note you will have to call
PHP Code:
<?php session_start(); ?>
at the start of each page. You could also query the database from the popup page, but I think that using sessions is probably a better way to do it.
Oh by the way I am running SSL on both site can I safely pass the session id thru the url?
Not sure, are you saying that you are using two separate websites or that you want to pass the session id between pages on the same website?
Regards,
Guy
Bookmarks