Click to See Complete Forum and Search --> : Opening modal window and passing variable to it to use in php code


sharapov
11-19-2003, 07:31 PM
Let's say I'm generating a modal window with the following code:


function doit(){

window.showModalDialog("index.php","","dialogHeight: 300px;
dialogWidth: 300px; dialogTop: px; dialogLeft: px;
edge: Raised; center: Yes; help: No; resizable: No; status: No;");
}



and calling it with:

<button onclick="doit()">Test</button>


My question is: Is it possible to pass some variable to the new opened window (some number like ID for example) so that I can use this variable in the new opened page. (to run this number against MySQL database for example).

I know it can be done if I do something like index.php?id=1234, and then grab it with $_GET. But I'd rather have modal window. Can anybodu help?

pyro
11-19-2003, 09:55 PM
<?PHP
$id = "1234";
?>
function doit(){

window.showModalDialog("index.php?id=<?PHP echo $id; ?>","","dialogHeight: 300px;
dialogWidth: 300px; dialogTop: px; dialogLeft: px;
edge: Raised; center: Yes; help: No; resizable: No; status: No;");
}Does that not work?